Hello
I have some JS that checks form field validation on a Web page, and it does so effectively, and here is the part that deals with the Submit button:
At the end, instead of displaying that Alert box, is it possible to automatically direct the user to a 'Thank you' page?
The code that actually processes the email is in Classic ASP.
Thanks!
I have some JS that checks form field validation on a Web page, and it does so effectively, and here is the part that deals with the Submit button:
Code:
$("#contact_submit button").click(function(event){
var form_data=$("#contact").serializeArray();
var error_free=true;
for (var input in form_data){
var element=$("#contact_"+form_data[input]['name']);
var valid=element.hasClass("valid");
var error_element=$("span", element.parent());
if (!valid){error_element.removeClass("error").addClass("error_show"); error_free=false;}
else{error_element.removeClass("error_show").addClass("error");}
}
if (!error_free){
event.preventDefault();
}
else{
alert('No errors: Form will be submitted');
}
At the end, instead of displaying that Alert box, is it possible to automatically direct the user to a 'Thank you' page?
The code that actually processes the email is in Classic ASP.
Thanks!