Welcome Guest, Not a member yet? Register   Sign In
how to post datepicker value in to text box
#1

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?
Reply
#2

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

How to add DatePicker when i click on text box?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB