From edb40f1c68c9b69d4e9ec9ece5245f3bf84e1709 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wulf=20S=C3=B6lter?= Date: Fri, 30 Jun 2017 10:43:00 +1200 Subject: [PATCH] Custom Pattern and Validator code fix JS example fixed - set defaults **before** initializing foundation. Won't work otherwise. --- docs/pages/abide.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.47.2