]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixes little bug #7624 7634/head
authorjk <j.koehler@modulingo.de>
Sat, 19 Dec 2015 22:29:22 +0000 (23:29 +0100)
committerjk <j.koehler@modulingo.de>
Sat, 19 Dec 2015 22:29:22 +0000 (23:29 +0100)
because type patterns are validated through options.patterns we can check pattern!=type to not check patterns like reset,submit,text...

js/foundation.abide.js

index 527291da726f4ab99164bb3ac6733f00fdea50ef..846636ca49876ea25dfda9897bb3c7210e7f1e6b 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) :
-           pattern ? new RegExp(pattern).test(inputText) : true : true;
+           pattern && pattern!=$el.attr('type') ? 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