Click to See Complete Forum and Search --> : <input type='radio'>


Detroit man
January 28th, 2003, 05:32 PM
Hi everybody!

Does somebody knows if i have 4 radio button but i have to give them seperate names will i be able to select only one after i do that??

Ex:
<code>
Male <input type='radio' name='male' value='m'>
Female<input type='radio' name='female' value=f>
Unspecified<input type='radio' name='Unspecified' value='U'>
Refused to give<input type='radio' name='refused' value='r'>
</code>

they all have different names but i want the user to only select one like if they had all the same name

Is there a way?

Thanks

mamo
January 28th, 2003, 06:01 PM
Try this....

<HTML>
<HEAD>
<SCRIPT LANGUAGE="Javascript">
<!--
function Checked(strVal)
{
if ("0" == strVal)
{
checkbox1.checked = true;
checkbox2.checked = false;
checkbox3.checked = false;
}
else if("1" == strVal)
{
checkbox1.checked = false;
checkbox2.checked = true;
checkbox3.checked = false;
}
else if("2" == strVal)
{
checkbox1.checked = false;
checkbox2.checked = false;
checkbox3.checked = true;
}
}

//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#7AA1E6">
<DIV ID=OBJ1></DIV>
<BR>
<BR>
<INPUT onclick="Checked('0')" id=checkbox1 type=radio name=cbox1 value="ON">&nbsp;<FONT face=Arial size=2>Control 1</FONT></INPUT>
<BR>
<INPUT onclick="Checked('1')" id=checkbox2 type=radio name=cbox2 value="ON">&nbsp;<FONT face=Arial size=2>Control 2</FONT></INPUT>
<BR>
<INPUT onclick="Checked('2')" id=checkbox3 type=radio name=cbox3 value="ON">&nbsp;<FONT face=Arial size=2>Control 3</FONT></INPUT>

</BODY>
</HTML>

-MA