I am using jquery-1.4.4 in struts. I had successfully used the jquery.validate plugin and validated my request form. But since it is a 3 page form, I have to give a confirm dialog box at each page to ensure users recheck their form entries.
$(document).ready(function() {
:::
$("#Form1").validate({
::
});
function onSubmitForm(){
var vconf = confirm(" You are about to submit, please recheck the the fields");
if(vconf){
return true;
}else{
return false;
}
}
});
and my submit button
<input type="submit" title="continue filling up the form" value=" Continue "
onclick= "return onSubmitForm();"/>
This first calls my confirm dialog and then does validation, which is not appropriate to first ask the user if he actually wants to continue and then stop them saying that their form is not valid.
perhaps this should help you. Jquery validate onValid.
Just call the function
onSubmitForm()
after you submit, and submit the form using javascript.