Click to See Complete Forum and Search --> : Values of radiobuttons


IWeb
03-31-2004, 06:22 AM
Hello,

I have 5 radiobuttons (not located in a form):

<input type="radio" name="rdbLevel" value="1">
.
.
.<input type="radio" name="rdbLevel" value="5">


When I try to access a radio button with
document.getElementById("rdbLevel").value
I get only the value of the first radiobutton (of course only when it's checked).

How can I check which radionbutton has been checked and how can I retrieve its value?

thanks,

JayDie
03-31-2004, 06:25 AM
attribute 'checked'
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/checked.asp

see: msdn library

http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_radio.asp

JayDie

IWeb
03-31-2004, 06:35 AM
thanks, it works now.