I use Jquery form validation to validate form input data. There is a
confirm
check on
submit of this form. .
The code is:
<script type="text/javascript">
function Confirmation(){
var answer = confirm("Do you really want to withdraw this amount of money from your account?")
if (answer){
return true;
}
else{
return false;
}
}
$(document).ready(function() {
$("#withdraw").validate({
rules: {
amount: {
required: true,
digits:true
} ,
bank:{
required:true,
},
cardnumber1: {
required: true,
minlength:8
},
cardnumber2:{
required:true,
equalTo: "#cardnumber1"
},
holder:{
required:true,
}
}
})
});
</script>
I want the Jquery form validation is executed before the Confirmation()
, how to do it?