jbroadway / elefant

Elefant, the refreshingly simple PHP CMS and web framework.
http://www.elefantcms.com
MIT License
209 stars 39 forks source link

Option to validate form fields on change instead of on submit #268

Closed jbroadway closed 9 years ago

jbroadway commented 9 years ago

We could add a special validation rule validate_on_change to the validation rules and it could tell the client-side validation to validate that set of rules as the user types instead of waiting until the whole form is filled out. For example:

[message_body]
validate_on_change = 1
contains = "*|TEMPLATE_TAG|*"

This would cause it to display a validation error if the template tag *|TEMPLATE_TAG|* were removed or mistyped in the message_body while the user is filling out the field.