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
Like the declarative nature of providing error messages, it should be possible to set validation rules on inputs declaratively.
jQuery Validation has a data-rule-* format for these, where you can pass settings in to the validation rule in the attribute value, if necessary.
As far as I can see from the code as it is now, you'd have to iterate over all the inputs that need a custom validator and pass them through the addValidator method one by one.
The text was updated successfully, but these errors were encountered:
I'm not against such a feature (and implemented things like that myself several times), but what would be a rule that one could add, and that cannot be built with a combination of existing attributes like pattern? Or would that be a general-purpose rule like creditcard or phoneUS like in jQuery Validation?
The point why I'm a bit hesitating is, that I plan with #14 to open up the inner workings of Hyperform, so one could write plugins, that could do things like, in the extreme case, add support for new type values. I haven't quite made up my mind how that will work out in the end, but I'd like to sort that out first, before implementing a rules feature.
The "equalTo" validation from jQuery Validation is maybe a good example of this. Other use cases are when you need to validate something via an AJAX request (I have another issue filed for clarification/example of how this can be done with hyperform).
Like the declarative nature of providing error messages, it should be possible to set validation rules on inputs declaratively.
jQuery Validation has a data-rule-* format for these, where you can pass settings in to the validation rule in the attribute value, if necessary.
As far as I can see from the code as it is now, you'd have to iterate over all the inputs that need a custom validator and pass them through the addValidator method one by one.
The text was updated successfully, but these errors were encountered: