You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the data-parsley-foobar="100" attribute on the text input field. The 100 is intentional, it looks like a number but I intend to treat it as a string in my validator.
And so, when registering my validator I'm passing requirementType: 'string' into Parsley.addValidator. However, when invoked, my validateString function is passed a requirement of type number:
Parsley 2.8.1
jQuery 3.x
I believe this is a bug, either in code or documentation.
I'm wiring up a custom validator, to validate a simple form:
Note the
data-parsley-foobar="100"
attribute on the text input field. The 100 is intentional, it looks like a number but I intend to treat it as a string in my validator.And so, when registering my validator I'm passing
requirementType: 'string'
intoParsley.addValidator
. However, when invoked, myvalidateString
function is passed arequirement
of typenumber
:I can't for the life of me figure out why my
requirement
is a JSnumber
when I've specifiedrequirementType: 'string'
.Here's a JSFiddle:
http://jsfiddle.net/rf8nyzb0/
Is this a bug, or am I completely misunderstanding the
'string'
requirement parameter documentation at http://parsleyjs.org/doc/#custom-requirement ?CC // @larrysteinke
The text was updated successfully, but these errors were encountered: