From: jk Date: Fri, 18 Dec 2015 22:06:13 +0000 (+0100) Subject: adds support for own RegEx Patterns through pattern attribute to be html5 conform X-Git-Tag: v6.1.0~4^2^2~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7624%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git adds support for own RegEx Patterns through pattern attribute to be html5 conform http://www.w3schools.com/tags/att_input_pattern.asp --- diff --git a/js/foundation.abide.js b/js/foundation.abide.js index 1f3f7ac2a..d2802ea28 100644 --- a/js/foundation.abide.js +++ b/js/foundation.abide.js @@ -335,7 +335,7 @@ return inputText.length ?//if text, check if the pattern exists, if so, test it, if no text or no pattern, return true. this.options.patterns.hasOwnProperty(pattern) ? this.options.patterns[pattern].test(inputText) : - true : true; + pattern ? new RegExp(pattern).test(inputText) : true : true; }; /** * Determines whether or a not a radio input is valid based on whether or not it is required and selected