]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
adds support for own RegEx Patterns through pattern attribute to be html5 conform 7624/head
authorjk <j.koehler@modulingo.de>
Fri, 18 Dec 2015 22:06:13 +0000 (23:06 +0100)
committerjk <j.koehler@modulingo.de>
Fri, 18 Dec 2015 22:06:13 +0000 (23:06 +0100)
http://www.w3schools.com/tags/att_input_pattern.asp

js/foundation.abide.js

index 1f3f7ac2abf794b3480084d00af0b8a2c9980726..d2802ea28e2dd3590e34bdf741134a7e2c820dcb 100644 (file)
 
     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