All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.web.lib.js.bee.bee.validate.method.js Maven / Gradle / Ivy

There is a newer version: 6.2.04
Show newest version
(function(b){b.validator.addMethod("alphanumeric",function(d,a){return this.optional(a)||/^\w+$/i.test(d)},"Letters, numbers or underscores only please");b.validator.addMethod("lettersonly",function(d,a){return this.optional(a)||/^[a-z]+$/i.test(d)},"Letters only please");b.validator.addMethod("phone",function(a,d){a=a.replace(/\s+/g,"");return this.optional(d)||a.match(/^[0-9 \(\)]{7,30}$/)},"Please specify a valid phone number");b.validator.addMethod("postcode",function(a,d){a=a.replace(/\s+/g,"");return this.optional(d)||a.match(/^[0-9 A-Za-z]{5,20}$/)},"Please specify a valid postcode");b.validator.addMethod("date",function(a,d){a=a.replace(/\s+/g,"");return this.optional(d)||a.match(/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/)});b.validator.addClassRules({date:{date:false},alphanumeric:{alphanumeric:true},lettersonly:{lettersonly:true},phone:{phone:true},postcode:{postcode:true}});b.validator.setDefaults({errorElement:"span"});b.validator.autoCreateRanges=true})(jQuery);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy