Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 input required - how to disable

JQuery Validate intercepts the required attribute e.g.

<input type="text" required />

This will force client side validation of the field which is great. Now this also is part of the HTML5 spec and causes browsers that support that to show validation messages even if JavaScript is disabled.

In my application I have already built the server side validation which I am happy with so I want to stop this behaviour. So my question is how can you disable this HTML5 form validation?

Update There seems to be some confusion, basically I am happy with the JQuery validate interpreting that and the validation firing that is great. However, should a user have JavaScript disabled I want the validation to fall back to the server side validation that I have already written. However, because JQuery Validate and HTML5 share the same mark up it is not submitting the form but rather showing the HTML5 validation messages which is what I wish to disable. Does this make sense?

like image 888
baynezy Avatar asked Jun 20 '13 20:06

baynezy


1 Answers

Add novalidate parameter in form object to stop browser validating the form.

<form action="test.do" novalidate>
   <input type="text" required />
</form>
like image 90
M.G.Manikandan Avatar answered Sep 29 '22 14:09

M.G.Manikandan