From: Wulf Sölter Date: Thu, 29 Jun 2017 22:43:00 +0000 (+1200) Subject: Custom Pattern and Validator code fix X-Git-Tag: v6.4.1~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10298%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Custom Pattern and Validator code fix JS example fixed - set defaults **before** initializing foundation. Won't work otherwise. --- diff --git a/docs/pages/abide.md b/docs/pages/abide.md index f419710ee..4888511e9 100644 --- a/docs/pages/abide.md +++ b/docs/pages/abide.md @@ -344,9 +344,14 @@ website: { * Add new patterns and validators before or after foundation is initialized ```javascript -$(document).foundation(); + +// Set paramaters Foundation.Abide.defaults.patterns['dashes_only'] = /^[0-9-]*$/; Foundation.Abide.defaults.validators['greater_than'] = + +// Init Foundation +$(document).foundation(); + function($el,required,parent) { // parameter 1 is jQuery selector if (!required) return true;