Why I cant set min value of input type date to today?
up vote
3
down vote
favorite
I want to set min date to today but it doesnt work.
Can you please correct me?
My code:
echo '<input type="date" name="date" min="'.<?php echo date("Y-m-d"); ?>.'">';
thanks
php date input
add a comment |
up vote
3
down vote
favorite
I want to set min date to today but it doesnt work.
Can you please correct me?
My code:
echo '<input type="date" name="date" min="'.<?php echo date("Y-m-d"); ?>.'">';
thanks
php date input
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I want to set min date to today but it doesnt work.
Can you please correct me?
My code:
echo '<input type="date" name="date" min="'.<?php echo date("Y-m-d"); ?>.'">';
thanks
php date input
I want to set min date to today but it doesnt work.
Can you please correct me?
My code:
echo '<input type="date" name="date" min="'.<?php echo date("Y-m-d"); ?>.'">';
thanks
php date input
php date input
edited Nov 22 at 0:17
asked Nov 22 at 0:06
Jacob
354
354
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Your date is not being printed into the input.
echo "<input type='date' name='date' min='".date('Y-m-d')."'>";
I also swapped the quotations so you could just use the variable within the echo without involving more.
Test example
add a comment |
up vote
6
down vote
You don't need <?php
and ?>
inside already existing<?php ?>
tag.
<?php echo '<input type="date" name="date" min="' . date("Y-m-d") .' ">'; ?>
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Your date is not being printed into the input.
echo "<input type='date' name='date' min='".date('Y-m-d')."'>";
I also swapped the quotations so you could just use the variable within the echo without involving more.
Test example
add a comment |
up vote
1
down vote
accepted
Your date is not being printed into the input.
echo "<input type='date' name='date' min='".date('Y-m-d')."'>";
I also swapped the quotations so you could just use the variable within the echo without involving more.
Test example
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Your date is not being printed into the input.
echo "<input type='date' name='date' min='".date('Y-m-d')."'>";
I also swapped the quotations so you could just use the variable within the echo without involving more.
Test example
Your date is not being printed into the input.
echo "<input type='date' name='date' min='".date('Y-m-d')."'>";
I also swapped the quotations so you could just use the variable within the echo without involving more.
Test example
edited Nov 22 at 9:37
answered Nov 22 at 0:26
Diogo Santo
3848
3848
add a comment |
add a comment |
up vote
6
down vote
You don't need <?php
and ?>
inside already existing<?php ?>
tag.
<?php echo '<input type="date" name="date" min="' . date("Y-m-d") .' ">'; ?>
add a comment |
up vote
6
down vote
You don't need <?php
and ?>
inside already existing<?php ?>
tag.
<?php echo '<input type="date" name="date" min="' . date("Y-m-d") .' ">'; ?>
add a comment |
up vote
6
down vote
up vote
6
down vote
You don't need <?php
and ?>
inside already existing<?php ?>
tag.
<?php echo '<input type="date" name="date" min="' . date("Y-m-d") .' ">'; ?>
You don't need <?php
and ?>
inside already existing<?php ?>
tag.
<?php echo '<input type="date" name="date" min="' . date("Y-m-d") .' ">'; ?>
edited Nov 22 at 0:22
answered Nov 22 at 0:10
SilvioCro
15012
15012
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422155%2fwhy-i-cant-set-min-value-of-input-type-date-to-today%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown