10-26-2018, 09:51 PM
how to post datepicker value into text box.
conditions
1,default date with time in text box
2,if datepicker selected that value to be in textbox.
what wrong in my query.
it return 1970-01-01 05:30:0000
how to solve this?
conditions
1,default date with time in text box
2,if datepicker selected that value to be in textbox.
Code:
datepicker
**********
<input id="datepic" class="form-control search-query" name="valdate" type="text"
value="<?php echo isset($_POST['valdate']) ? $_POST['valdate'] : '' ?>" >
input field
************
<?php $edate=strtotime($_POST['valdate']);
$edate=date("Y-m-d H:i:ss",$edate); ?>
<input type="text" name="valudate" value="<?php echo $edate ;?>"
value="<?php echo isset($_POST['valdate']) ? $_POST['valdate'] : date('Y-m-d') ?>" />
it return 1970-01-01 05:30:0000
how to solve this?