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;
}

Hi,

Can you post the html code that you are using.

<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>

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.