tags:

views:

47

answers:

3
+1  Q: 

Jquery Validation

Hi,

Is there is any way to validate form using jquery on dynamic fields.

I want to make it required fields

I am creating form fields dynamically using Jsp.

like

<form name="myForm" id="myForm">
<input type="text" name="name1" value="">
<input type="text" name="name2" value="">
<input type="text" name="name3" value="">
<input type="text" name="name4" value="">
</form>

so on....

I want to validate this form fields with required form field.

+1  A: 

check this article :

http://www.codeproject.com/KB/aspnet/RequiredField.aspx

even thought is written using asp.net you can also use it for normal html

Pranay Rana
+1  A: 

You could "tag" your form element with a class name like "required" in JSP. Then onSubmit you can check if any $(".required",form) has empty value.

ungarida
+1  A: 

Have a look at this jQuery plugin: Validation , its demo and the view source. I think you can also generate this little javascript dynamically with your form fields.

Ismail