0

Hi all,

Can i know how to do the checkbox validation........
i used the code below but its not validating.....

var val;
for(i=0;i<3;i++)
{
if(form2.elements['contype[]'][i].checked)
val=1;
}
if(val==0)
{
alert("Select type of your Contract")
return false;
}
3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Thirusha
0
<html>
<head></head>
<body>	
<tr>
	<td valign="top">Which type of Contractor, <br>you are?</td>
	<td valign="top"><strong>:</strong></td>
																<td><input type="Checkbox" name="contype[]"  value="A"> Auto Glass<br>
<input type="Checkbox" name="contype[]" value="W"> Windows and Patio Doors with Frames<br>
<input type="Checkbox" name="contype[]" value="T"> Glass for Table tops, Mirrors and Shower doors&nbsp;&nbsp;&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
	</tr>
</body>
</html>
0

I dont see any place where u are calling the javascript function that will do the validation.

U could have a button that will call that function then the validation might work.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.