talat
10-19-2004, 11:51 AM
hi friend
actually what i was trying to do is
BY CLICKING ON ONE CHECK BOX ALL THE REMAINING CHECKBOX SHOULD ALSO BE SELECTED OR DESELECTED as it is in our inbox page of mail accounts .But its not worling for me plz see my code and do reply i need help
//my code is the script portion is
<script language="javascript">
function all()
{
if(document.form1.base.checked==true)
for(i=0;i<document.form1.powers.lenghth;i++)
{
document.form1.powers[i].checked=true;
}
else
for(i=0;i<document.form1.powers.lenghth;i++)
{
document.form1.powers[i].checked=false;
}
}
</script>
//the form portion is
<form name="form1" method="post" action="">
<p>
<input name="base" type="checkbox" onclick="all()">
select/deselect</p>
<p>
<input name="powers" type="checkbox" >
Mody </p>
<p>
<input name="powers" type="checkbox" >
Talat</p>
<p>
<input name="powers" type="checkbox" >
Qamar</p>
<p>
<input name="powers" type="checkbox" >
Jaffer</p>
<p>
<input name="powers" type="checkbox" >
Babbooo
</p>
</form>
i want that when click the BASE check box all the other get select or deselect
WATING FOR REPLY
actually what i was trying to do is
BY CLICKING ON ONE CHECK BOX ALL THE REMAINING CHECKBOX SHOULD ALSO BE SELECTED OR DESELECTED as it is in our inbox page of mail accounts .But its not worling for me plz see my code and do reply i need help
//my code is the script portion is
<script language="javascript">
function all()
{
if(document.form1.base.checked==true)
for(i=0;i<document.form1.powers.lenghth;i++)
{
document.form1.powers[i].checked=true;
}
else
for(i=0;i<document.form1.powers.lenghth;i++)
{
document.form1.powers[i].checked=false;
}
}
</script>
//the form portion is
<form name="form1" method="post" action="">
<p>
<input name="base" type="checkbox" onclick="all()">
select/deselect</p>
<p>
<input name="powers" type="checkbox" >
Mody </p>
<p>
<input name="powers" type="checkbox" >
Talat</p>
<p>
<input name="powers" type="checkbox" >
Qamar</p>
<p>
<input name="powers" type="checkbox" >
Jaffer</p>
<p>
<input name="powers" type="checkbox" >
Babbooo
</p>
</form>
i want that when click the BASE check box all the other get select or deselect
WATING FOR REPLY