Hi all,
could you take a look at this http://jsbin.com/osolo/ please?
If you enter a letter in Min Age rather than a number then hit submit this validates using jquery validator using a regular expression in a custom validation method, this works but i'm now looking to make it a little more dynamic.
In the custom validation method the line
var data = $(element).metadata();
grabs meta data from the element being validated, what i would like to do is use the
data.validateOptions.regex
as the regex to test with (i can't see this being a problem), what i can see being a problem is that if the field doesn't validate, rather than using a message that is supplied when calling
jQuery.validator.addMethod(name, method, message)
i'd like to use
data.validateOptions.message
as the error message from within the custom method, can anyone point me in the right direction please?
Thanks
OneShot