Menu icon Foundation
F6 Abide custom validators not working.

Been trying to get this to work for an hour now & not getting anywhere. This is basically copied right from the Docs... 

 

 

$(document).foundation();

Foundation.Abide.defaults.validators.greater_than = function($el,required,parent) {
	console.log('greater_than validation failed');
  return false;
};

I've also seen it written as: 

 

$(document).foundation();

Foundation.Abide.defaults.validators['greater_than'] = function($el,required,parent) {
	console.log('greater_than validation failed');
  return false;
};

 

then in my form to try and test it:

 

 

<fom abide novalidate>
<input name="greaterthan"  data-validator="greater_than"  value="" />
<input type="submit" name="registerbtn" class="button primary expand" value="Register" />
</form>

 

all I get in both cases is a "Uncaught TypeError: n.options.validators[e] is not a function" error. 

 

what is wrong?  the docs do not seem to outline how to create a custom validator correctly. 

 

abidecustom validator

Been trying to get this to work for an hour now & not getting anywhere. This is basically copied right from the Docs... 

 

 

$(document).foundation();

Foundation.Abide.defaults.validators.greater_than = function($el,required,parent) {
	console.log('greater_than validation failed');
  return false;
};

I've also seen it written as: 

 

$(document).foundation();

Foundation.Abide.defaults.validators['greater_than'] = function($el,required,parent) {
	console.log('greater_than validation failed');
  return false;
};

 

then in my form to try and test it:

 

 

<fom abide novalidate>
<input name="greaterthan"  data-validator="greater_than"  value="" />
<input type="submit" name="registerbtn" class="button primary expand" value="Register" />
</form>

 

all I get in both cases is a "Uncaught TypeError: n.options.validators[e] is not a function" error. 

 

what is wrong?  the docs do not seem to outline how to create a custom validator correctly. 

 

Rickard Jenen 11 days ago

I had the same problem, got it working when I defined my custom validator before Foundation init.

Grace Jackson 10 days ago

In the long time past days, Excel had a to a great degree unwieldy programming tongue without a name. Cheap Papers Service Surpass desires Macros, we called it. It was a genuinely pointless programming lingo without factors (you expected to store regards in cells on a worksheet), without nearby individuals, without subroutine calls: basically, it was absolutely unmaintainable. It had pushed features like "Goto," however the imprints were completely indistinct.

Grace Jackson 10 days ago

In the long time past days, Excel had a to a great degree unwieldy programming tongue without a name. Cheap Papers Service Surpass desires Macros, we called it. It was a genuinely pointless programming lingo without factors (you expected to store regards in cells on a worksheet), without nearby individuals, without subroutine calls: basically, it was absolutely unmaintainable. It had pushed features like "Goto," however the imprints were completely indistinct.