Form to use AJAX rather than a page refresh but also utilise error handling?
I have a webform that I am about to integrate on my site.
http://app.bronto.com/public/webform/render_form/gmy3v1ej883x2lffibqv869a2e3j9/37ea72cebcc05140e157208f6435c81b/addcontact/
Firstly is the error handling. If you don't enter a name or valid email,
validation messages appear on the page, but only after a page refresh.
Secondly, on submitting a valid (not empty) name and valid email address,
it submits and redirects (redirect url site is currently offline).
My question is, how can I serialize the form to not refresh the page for
both error message display AND submit? If submitted with no errors a
message such as "You have been subscribed" should appear.
I have tried with if data == success for displaying the success message
but no luck. I also can't seem to get the error messages displaying if
it's not a success, which I presume is my issue with determining if
there's an error or success.
In short, I'm trying to use ajax for the error messages and a success
message on submit, without any refresh.
Any ideas on this one? Thanks
No comments:
Post a Comment