When using jQuery validate on a form it was picked up that the email field was not checking the length of each section, just the format ‘e.g. [email protected]’.
After googling it was suggested that a custom validator was the best solution to this issue.
12345678 //custom validator method to apply regex to email field validationjQuery.validator.addMethod("emailCustom", function (value, element, params) {var re = /^(([^<>()[]\.,;:s@"]+(.[^<>()[]\.,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/;return re.test(value);}, "Please enter a valid email address.");
Adding the above validator to my script file and then referencingĀ it fromĀ the rules for the email field (below), fixed the problem
12345678910 rules:{'first_name': "required",'last_name': "required",'company_name': "required",'email': {required: true,emailCustom: true}......