GentleForm
GentleForm copied to clipboard
How to manually trigger an error?
I want to do additional checkes when the form isValid, i.e. like when validating a multiple checkbox list. Is there a way to trigger an error and have the error box appear?
There is currently no way to add custom validators. The only supported ones are the ones from the HTML5 specification.
But your suggestion makes total sense and I'm willing to add that to the API. I'll need to think about it a bit, perhaps there's a way to add validators to the HTML5 API. In any case, I'll need to think about validation: when and how it should happen for custom validators.
@Zhouzi actually the scenario is when you have field that depend on other field's value or, as in may use case, when you have multiple checkboxes and at least 1 must be checked.