I’m trying to learn from the http://jquery.malsup.com/form/#getting-started example.
When I click submit, the alert of “Thank you for your comment” should pop up, however, it is not working for me. I was wondering if there was something you had to specifically add in comment.php that is being called by the form? Mine is just:
<?php
echo $_POST['comment'];
echo $_POST['name'];
?>
Should there be like a return success or something? How would you implement it?
Thanks
I just got it to work after I noticed that the page wasn’t actually loading any scripts.
If you copied-and-pasted the example HTML, as I did, try changing the src of the javascript, so that the scripts load and don’t return 404s. I.e. instead of jquery-1.3.2.js, insert the full http://jquery.malsup.com/jquery-1.3.2.js.
Assuming there’s no error, the PHP engine automatically returns a 200 success code in the header: