This form works in Safari. In IE, it mostly works, but I get an error "Object doesn't support this property or method." on line 240.
In Firefox, no alert box appears, but the following error appears in the error console:
Error: myform is not defined Line: 240 (line 240 is below, starting with the word if)
<script type="text/javascript">
// Validate the form
// Confirm with the visitor the amount he entered is correct
// Submit if OK is pressed
$(document).ready(function() {
$("#myform").validate({
submitHandler:function(form){
if(confirm("Please confirm your donation of $"+ myform.x_Amount.value + " to us.")){
form.submit();
}
}
});
});
// Put grey "no spaces" example text in the credit card number field
$('#x_Card_Num').example('(NoSpaces)', {
className: 'greydefaulttext'
});
</script>
Guess I need to define myform.x_Amount.value. Have tried doing this in various ways but haven't stumbled across the right location to define it yet, or even the right syntax. Thanks for any help.
Update: Thanks to fresh eyes from RC and Bobince, it was simply a typo: myform.x_Amount.value should be named form.x_Amount.value - it now works in all browsers.