Am having a very silly problem with Ajax Form Submission after validation of the form is complete… when I remove the ajax form submission, the email works fine, but when i do it, it doesn’t :|
Here is a live example of my form :arrow: Contact Form
The live example works fine and displays a thank you message but the actual email doesn’t go :(
I was having some problem in validating and submitting the form via AJAX as mentioned above, hence I got it working by setting the options for the ajaxForm() method. In the ‘beforeSubmit’ option I checked for the validation of the code and in the success option I just printed the thank you message..
// other available options:
//url: url // override for form’s ‘action’ attribute
//type: type // ‘get’ or ‘post’, override for form’s ‘method’ attribute
//dataType: null // ‘xml’, ‘script’, or ‘json’ (expected server response type)
//clearForm: true // clear all form fields after successful submit
//resetForm: true // reset the form after successful submit
// $.ajax options can be used here too, for example:
Well, the php code works just fine, but the problem I was facing was that I was unable to submit the form using AJAX, when I would call it from the call back function of the validation method. Just like Chris did it in one of his form tutorials. But I solved it by setting the options parameter of the ajaxForm() method, and its now working fine :)
You must be logged in to reply to this topic.