NYPD / ritsu.js

HTML form validation
MIT License
2 stars 0 forks source link

Proactive vs Reactive #98

Open ChekTek opened 6 years ago

ChekTek commented 6 years ago

Validation works great, but on numerous occasions our users have requested that the input be prevented beforehand rather than getting an error after the form is submitted. i.e. an input has the numeric class, prevent alpha characters from being typed, rather than waiting for the box to turn red after the form is submitted. Perhaps introduce a class of "aggressive" vs "lazy", or an attribute on the input. It could even be an attribute on the form to say this form is validated aggressively or lazily.

NYPD commented 6 years ago

ristu.js can be used in conjugation with javascript event listeners to allow or prevent user input. This could be a possible addition to the library, but a concern of mine is not telling the users why their input is not being registered.

I'll think about possible implementation of this.