I am try to post a data from a from I have this code on my html.
<javascript>
$(document).ready(function(){
$("#btnsubmit").click(function(e){
e.preventDefault();
var testData = $("#test").serialize();
$.ajax({
type: "POST",
url: "ajaxSurvey.php",
data: {survey:testData}
});
});
})
</javascript>
and my form
<form id="test" name="test" method="POST">
<input name="surveyperiod" id="surveyperiod" type="date">
<input name="deadline" id="deadline" type="date" >
<input type="submit" id="btnsubmit"name="btnsubmit" value=" Update ">
</form>
and my php page
if(isset($_POST['survey']){
$myDate = $_POST['survey'];
mysql_query('INSERT INTO (surveyperiod,deadline) VALUES (????????)');
}
Now how can I deserialize $myDate which is look like below
surveyperiod=2014-02-25&deadline=2014-02-18