Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery validation without "form" tag

According to http://docs.jquery.com/Plugins/Validation the "form" tag is necessary in order to do validation. In my case I don't have form tag. How can I validate(required field) my textbox on click of "button" type control

like image 515
Rocky Singh Avatar asked Jun 08 '11 17:06

Rocky Singh


People also ask

How to validate input field in JQuery without form?

Firstly, and most importantly, you must wrap your input elements inside <form></form> tags for the jQuery Validate plugin to operate. However, a submit button is not required. Secondly, you can programatically trigger the validity test of any or all elements without a submit button by using the . valid() method.

What is JQuery validation?

Validation in JQuery: Using JQuery, a form is validated on the client-side before it is submitted to the server, hence saves the time and reduce the load on the server. Form Validation means to validate or check whether all the values are filled correctly or not.


1 Answers

Why not just add a form tag? If it's an input, then it should normally be part of a form.

like image 77
Eric Avatar answered Sep 17 '22 11:09

Eric