Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Conversation

@i7an
Copy link

@i7an i7an commented Apr 25, 2015

Html:

<input type="text" data-pizza="0" />

Js:

$form.validator({
    custom: {
        pizza: function($el) {
            return true;
        }
    },
    errors: {
        pizza: '[Pizza] Error'
    }
});

This validator wont be applied because js treats 0 as falsy.

@lypwig
Copy link

lypwig commented Aug 26, 2015

Yes! I just need it!
I think this feature is interesting, because some validations doesn't need any argument. In this case, the html line will be refined, ie <input type="text" data-foo />, instead of <input type="text" data-foo="fake-value-to-make-it-work" />.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants