Check this..
<script language=3Djavascript>
function validatechk(){
var chktot;
chktot =3D 0
for (i=3D0; i<document.frm.length; i++) {
if (document.frm(i).checked=3D=3Dtrue)
chktot =3D chktot + 1
}
if (chktot > 5)
alert("you can't check more than 5 checkboxes!!");
}
</script>
<BODY><br><br>
<form action=3Dtest.html name=3Dfrm method=3Dpost
onSubmit=3Dvalidatechk()>
<input type=3Dcheckbox name=3DC1 >C1<br>
<input type=3Dcheckbox name=3DC1 >C2<br>
<input type=3Dcheckbox name=3DC1 >C3<br>
<input type=3Dcheckbox name=3DC1 >C4<br>
<input type=3Dcheckbox name=3DC1 >C5<br>
<input type=3Dcheckbox name=3DC1 >C6<br>
<input type=3Dcheckbox name=3DC1 >C7<br>
<input type=3Dcheckbox name=3DC1 >C8<br>
<input type=3Dcheckbox name=3DC1 >C9<br>
<input type=3Dcheckbox name=3DC1 >C10<br>
<input type=3Dtext name=3Dtest value=3D""><br>
<input type=3Dsubmit name=3Dsubmit value=3Dok>
</form>
<P> </P>
-----Original Message-----
From: Himanshu Chaudhari [mailto:himanshuchaudhari@y...]
Sent: Thursday, December 27, 2001 3:24 PM
To: sql language
Subject: [sql_language] checkbox
I am having a ASP page in which there is a checkbox
name C1.The no of checkbox increases with the database
values which the same checkbox name.
Let there are 10 checkbox with same name.Now I want
that users can't check more than 5 checkbox at the
time . How can I do it with javascript.
Himanshu
________________________________________________________________________
Download Logos, Picture Messages & Ringtones for your mobile phone
Visit http://mobile.yahoo.co.in
$subst('Email.Unsub').