dsheiko / HTML5-Form-Shim

⛔️ [DEPRECATED] That is a jquery plugin, which emulates HTML5 Form Validation on old browsers. The plugin also allows to customize form submission validation tooltips and field validation callbacks (e.g. via XMLHttpRequest)
http://dsheiko.github.io/HTML5-Form-Shim/
71 stars 17 forks source link

Default custom validators treat the field as required. #7

Closed phw closed 10 years ago

phw commented 10 years ago

I think the current behavior of treating fields of type email, number,tel and url as required is wrong. A input of this type should be valid if it is empty as long as it is not also marked as required.

This field is not required, but when input is present it has to be a valid email:

<input type="email" name="email">

This field is required, it can not be left empty and it has to be a valid email:

<input type="email" name="email" required>
dsheiko commented 10 years ago

Thanks for the feedback. I agree empty but not required inputs shall not be validated and that is something I can control in custom-validation mode (

) Just pushed the fixed release.