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
I'd like to write some docs for the "remove validation" feature. (I'm unfamiliar with the history of the "undebounce" feature, so I'll leave that for another day or another person.)
Comments:
I think the demo has the button text toggling the wrong way round. One must click the remove button repeatedly to show the expected text. Very minor point, not important, just something I found.
Questions, I want to know whether I understand the new behaviour:
To remove validation from a form, one uses v.remove(formElement)
One can readd validation to that form via v.scan(formElement)
Validation failure classes remain after removal, e.g. input-validation-error. This is by design as the form's original state could have been server-side errors. If the user wants different behaviour he can reset/remove them.
Is there a way to perform the "full reset" idea from this comment, or should one do that manually (possibly by clicking on the form's "reset" button, if it has one)?
I'm using document.querySelectorAll('form') or someButton.form to target the form; out of curiosity only (because the library has many cool undocumented features), is it possible to tell which forms the library is currently tracking? UPDATE: a reasonable way is let forms = [...new Set(Array.from(document.querySelectorAll('[data-val]')).map(x => x.form))]; forms.forEach(form => v.remove(form));
Anything else I need to know?
(Sorry for the long list of questions. The new bits are really useful, thanks!)
The text was updated successfully, but these errors were encountered:
Related to #110
I'd like to write some docs for the "remove validation" feature. (I'm unfamiliar with the history of the "undebounce" feature, so I'll leave that for another day or another person.)
Comments:
Questions, I want to know whether I understand the new behaviour:
v.remove(formElement)
v.scan(formElement)
input-validation-error
. This is by design as the form's original state could have been server-side errors. If the user wants different behaviour he can reset/remove them.document.querySelectorAll('form')
orsomeButton.form
to target the form; out of curiosity only (because the library has many cool undocumented features), is it possible to tell which forms the library is currently tracking? UPDATE: a reasonable way islet forms = [...new Set(Array.from(document.querySelectorAll('[data-val]')).map(x => x.form))]; forms.forEach(form => v.remove(form));
Anything else I need to know?
(Sorry for the long list of questions. The new bits are really useful, thanks!)
The text was updated successfully, but these errors were encountered: