I am having problems using the jquery validation plugin's submitHandler.
I am working within the confines of some code that I do not have access to change so I am trying to find some work arounds.
This is what I would like to do... After the form validates, when the user clicks the submit button, and it is successful redirect the page to a different page.
If I were not using jquery, I'd use the location.replace method and that is what I tried to use, but it does not seem like the submitHandler is executing because I tried a simple alert('TEST'); and it did not work.
$(document).ready(function(){
$("#myForm").validate({
submitHandler: function(form){
location.replace('http://www.google.com');
form.submit();
}
});
});
I tried this to test it out but it also did not work...
$(document).ready(function(){
$("#myForm").validate({
submitHandler: function(form){
alert("TEST");
form.submit();
}
});
});
The form submits and sends the email as it is supposed to when all of the fields are valid and it does not send the email with the fields are not valid. The only problem I have is handling the relocation of the page.
Any help anyone can provide would be greatly appreciated!