CodeIgniter Forums
how to post datepicker value in to text box - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: how to post datepicker value in to text box (/showthread.php?tid=72032)



how to post datepicker value in to text box - kvanaraj - 10-26-2018

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.
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') ?>" />
what wrong in my query.
it return 1970-01-01 05:30:0000
how to solve this?


RE: how to post datepicker value in to text box - InsiteFX - 10-27-2018

One of these days you will learn how to use Google Search.

How to add DatePicker when i click on text box?