Normally you make this kind of choices with RADIOBUTTONS.
But of course you can add some javascript to do it with checkboxes. See my examples:
(1): Here is some javascript that let you make only choose one of the 3 checkboxes.
(2): Is the same with radio-buttons (but see in example 3 that this javascript is no need !!!!!)
(3) As I said in the beginning normally you do it with only radiobuttons. Just give a group RB's the same name and you can only chose one of them. Keep it simple as it can be!!
<HTML>
<HEAD>
</HEAD>
<BODY>
<script language="Javascript">
function distextbox(value)
{
var DM = document.myform ;
nrCB = DM.CB.length;
for (ia = 0; ia < nrCB; ia++)
{
if (DM.CB[ia].value == value)
{
DM.CB[ia].checked = true;
}
else
{
DM.CB[ia].checked = false;
}
}
}
function disradio(value)
{
var DM = document.myform;
nrR = DM.RB.length;
for (ia = 0; ia < nrR; ia++)
{
if (DM.RB[ia].value == value)
{
DM.RB[ia].checked = true;
}
else
{
DM.RB[ia].checked = false;
}
}
}
</script>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.