using multiples addMethod jquery
Clash Royale CLAN TAG #URR8PPP using multiples addMethod jquery I want to customize the validations of my form using the addMethod function with the jQuery validator, but when I tried to add more than one method the validator seems to look only at the first one. Here is the code: jQuery.validator.addMethod("name", function(value, element) { return this.optional(element) || /^[A-Za-zÀ-ÖØ-öø-ÿ]{2,30}$/.test(value); }, "please enter a valid name"); jQuery.validator.addMethod("surname", function(value, element) { return this.optional(element) || /^[A-Za-zÀ-ÖØ-öø-ÿ]{1,30}-?[A-Za-zÀ-ÖØ-öø-ÿ]{1,30}$/.test(value); }, "please enter a valid surname"); $("#contactform").validate({ rules: { firstname:{ required: true, name: true, minlength: 2, maxlength: 30 }, lastname:{ required: true, surname: true, minlength: 2, maxlength: 30 } ...