Select only checkbox

[Total: 1    Average: 5/5]

These checkboxes can only be selected one at a time.

Body Code:

<SCRIPT>

function selecionatudo(check,n) {

for (i=0;i<5;i++) {

if (check) {

document.form1.chbx[i].checked=false;

}

}

document.form1.chbx[n-1].checked=true;

}

</SCRIPT>

<form name="form1" method="post" action="">

<INPUT TYPE=checkbox NAME="chbx" onClick="selecionatudo(true,1)"><br>

<INPUT TYPE=checkbox NAME="chbx" onClick="selecionatudo(true,2)"><br>

<INPUT TYPE=checkbox NAME="chbx" onClick="selecionatudo(true,3)"><br>

<INPUT TYPE=checkbox NAME="chbx" onClick="selecionatudo(true,4)"><br>

<INPUT TYPE=checkbox NAME="chbx" onClick="selecionatudo(true,5)"><br>

</FORM>

Times Viewed: 7

Leave a Reply

Your email address will not be published. Required fields are marked *