Send Data To $_post Array Via Ajax
I start to play music via button 'submit', and as a result my form is not sent to global array $_POST. How to do that? Should I use AJAX? How? Music plays, but form isn't sent :(
Solution 1:
There are a couple problems with this. First, you are overriding the click handler for your button. If you also want it to also post the form, you should return true;
at the end of your handler.
Also, you will find that the browser will reload the page when that happens, so there is no real reason you would want to play music. Instead you should add some PHP to add JavaScript that plays the music when you correctly receive the post data.
Alternatively, you could send the data with AJAX within your click handler, as @jszobody suggests.
Solution 2:
$.ajax({type:"POST",url:url,data:data,success:success,dataType:dataType});
Post a Comment for "Send Data To $_post Array Via Ajax"