Jump to content

passing datepicker value to php variable using load function


Mahesh1209

Recommended Posts

<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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.