Mahesh1209 Posted March 7, 2014 Share Posted March 7, 2014 <html> <head> <link rel="stylesheet" href="css/jquery-ui.css"> <script src="js/jquery-1.9.1.js"></script> <script src="js/jquery-ui.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#from").datepicker(); $("#to").datepicker(); var from=$("#from").val(); var to=$("#to").val(); $("#btn").click(function() { $("#datecheck").load("date2.php",{from:from,to:to},function(res){}); }); }); </script> </head> <body> <form action="#" method="post"> From:<input type="text" id="from" name="from"/> To: <input type="text" id="to" name="to"/> <input type="button" value="submit" id="btn"/> </form> <div id="datecheck"></div> </body> </html> //php code $from=$_POST['from']; echo $from; i am not getting the date value when i echoed in the same page. please any help. thanks in advance. Link to comment https://forums.phpfreaks.com/topic/286788-passing-datepicker-value-to-php-variable-using-load-function/ Share on other sites More sharing options...
paddy_fields Posted March 7, 2014 Share Posted March 7, 2014 Change <input type="button" value="submit" id="btn"/> to <button type="submit" value="submit" id="btn">Submit</button> Link to comment https://forums.phpfreaks.com/topic/286788-passing-datepicker-value-to-php-variable-using-load-function/#findComment-1471759 Share on other sites More sharing options...
cyberRobot Posted March 7, 2014 Share Posted March 7, 2014 The button can also be changed to (note the type attribute): <input type="submit" value="submit" id="btn"/> Link to comment https://forums.phpfreaks.com/topic/286788-passing-datepicker-value-to-php-variable-using-load-function/#findComment-1471762 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.