This project is read-only.
1
Vote

Is data annotation - clientside passOnNull always truthy

description

Currently, if the 'Is' data annotation is used directly, then the client side validation function always has a truthy value for passOnNull.

i.e.
foolproof.is = function (value1, operator, value2, passOnNull) {
    if (passOnNull) { ... } ...
}
passOnNull will either equal "True" or "False" - as a string.
So in both scenarios, the if will evaluate to true.

This hasn't affected the other annotations which make use of the Is function, because the passOnNull parameter is ommited.
e.g. for requiredif:
if (vpvalidation.is(dependentValue, operator, dependentTestValue)) { ... }

comments