Talha5389
Talha5389

Reputation: 740

HTML validations from javascript

<input type="text" id="newFname" pattern="^[a-zA-z0-9 _-]{2,}$" required placeholder="First Name" />

<input type="text" id="newLname" pattern="^[a-zA-z0-9 _-]{2,}$" required placeholder="Last Name"/>

Is it possible to disable html validation on second input without modifying pattern or required attributes?

Upvotes: 0

Views: 76

Answers (1)

Sjors van Dongen
Sjors van Dongen

Reputation: 490

What you could do, put the inputs in separate forms and add the novalidate attribute to the second form.

Check this page for more information.

Upvotes: 1

Related Questions