Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tick box query 1

Status
Not open for further replies.

jamica

Programmer
Apr 25, 2005
17
GB
im trying to make a selection of tick boxes so that the user can select only one not mutliple. these tick boxes have a function already assigned to them for sending in an email and if the form is returned with null values on other fields if any of these boxes are checked they will retain the checked value.

I have tried using radiobuttons but i cudnt get them to work

any ideas or help would be appreciated thanks
 
I think you miss the set keyword that's all. Here is a demo of how you do it.
[tt]
<html>
<head>
<script language="vbscript">
sub checkit
set celem=document.f.b
msgbox celem.length
for i=0 to celem.length-1
msgbox celem.item(i).value & vbcrlf & celem.item(i).checked
'alternative way to reference to it
msgbox celem(i).value & vbcrlf & celem(i).checked
next
end sub
</script>
</head>
<body>
<form name="f">
<input type="radio" name="b" id="b1" value="bv1" onclick="checkit" />radiobtn-1<br />
<input type="radio" name="b" id="b2" value="bv2" onclick="checkit" />radiobtn-2<br />
</form>
</body>
</html>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top