Load Additional Claim Documents
$().ready(function () {
// form validation
var validator = $("#myform").validate({
// ignore hidden fields
ignore: [],
// set rules
rules: {
ctl00$MainContent$inputEmail: {
required: true,
email: true
},
ctl00$MainContent$inputConfirmation: {
required: true,
minlength: 9,
maxlength: 9,
alphanumeric: true
},
ctl00$MainContent$checkTerms: "required"
},
// define error messages
messages: {
ctl00$MainContent$inputEmail: {
required: "Please enter email address associated with your claim",
email: "Please provide a valid email address",
},
ctl00$MainContent$inputConfirmation: {
required: "Please enter the confirmation number that was emailed to you",
minlength: "Please enter 9 alphanumeric characters",
maxlength: "Please enter 9 alphanumeric characters",
},
ctl00$MainContent$checkTerms: "You must agree before submitting",
},
// define error placement
errorPlacement: function (error, element) {
if (element.attr("name") == "ctl00$MainContent$checkTerms") {
error.insertAfter($("div.terms-error"));
} else {
error.insertAfter(element);
}
},
});
// custom alphanumeric validator method
$.validator.addMethod(
"alphanumeric",
function (value, element) {
return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value);
},
"Please enter only alphabetic characters and numbers"
);
});