submitHandler is an invalid label
- by Steven
Below is the code, I get an error which says that submitHandler is an invalid label
$(document).ready(function() {
$("#withdraw").validate({
rules: {
amount: {
required: true,
number:true,
min:0,
max:<?php echo $balance; ?>
} ,
bank:{
required:true,
},
cardnumber1: {
required: true,
minlength:8
},
cardnumber2:{
required:true,
equalTo: "#cardnumber1"
},
holder:{
required:true,
}
}
}),
submitHandler: function(form){
var answer = confirm("Do you really want to withdraw this amount of money from your account?")
if (answer){
form.submit();
}
else{
return false;
}
}
});
How to solve this problem?