makamo66 Posted December 31, 2013 Share Posted December 31, 2013 This is a very basic question. I don't know how to get the post data from the jquery multidatespicker. When I submit the page I want to echo back the post variables but I don't see how they're sent with jquery. Quote Link to comment Share on other sites More sharing options...
makamo66 Posted December 31, 2013 Author Share Posted December 31, 2013 In the html: <div id="simpliest-usage" class="box"></div><br /> <form method="POST" action="http://beta.opentemp.local/user/dashboard" accept-charset="UTF-8" id="submit_mdp"><input name="_token" type="hidden" value="9jlMjOzit5sZBGPkYQfwXwSerdzSnZXYVnEyr9Yx"><input class="mdp_button" type="submit" value="Submit"></form> In the javascript $( "#submit_mdp" ).submit(function( event ) { $.ajax({ url: 'http://beta.opentemp.local/user/dashboard', data: $("form#submit_mdp").serialize(), type: 'POST', 'beforeSend': function(xhr, settings) { console.log( $("form#submit_mdp").serialize() ); console.log('ABOUT TO SEND'); }, 'success': function(result, status_code, xhr) { console.log('SUCCESS!'); }, 'complete': function(xhr, text_status) { console.log('Done.'); }, 'error': function (XMLHttpRequest, textStatus, errorThrown) { alert("Error with ajax Function: "+ textStatus+" "+errorThrown); } }); }); in the php print_r($_POST); The multidatespicker is a modal. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.