Hi,
I am using benjamin keen's jQuery validation RSV and i have a couple of questions:
1/ How do i setup the function submitData?
- //validation test
- function submitData()
{
alert("The form validates! (how do i submit the data to stage3.php).");
return false;
}
- $("#reserveringForm").RSV({
onCompleteHandler: submitData,
displayType: "alert-one",
rules: [
"required,first_name,Please enter your first name.",
"required,last_name,Please enter your last name.",
"required,email,Please enter your email address.",
"valid_email,email,Please enter a valid email address.",
"function,testFunc",
]
});
2/ i call a custom function testFunc. But when testFunc returns false, RSV still calls submitData
- function testFunc() {
testField = $('#testField').val();
if (testField != '') {
//alert ("Credit card has a valid format");
return true;
}
else {
alert ("Testfield is empty");
$('#testField').focus();
return false;
}
}
Any suggestions?