W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2006

Radio button group

From: Waters, Tyler S FOR:EX <Tyler.Waters@gov.bc.ca>
Date: Thu, 16 Mar 2006 16:51:54 -0800
Message-ID: <75288380B55B044BB95108574F19D0231B71BD@hill.idir.bcgov>
To: <www-dom@w3.org>


I'm curious if I'm missing something when it comes to using
..getElementById on radio buttons. 

Say I have a series of radio buttons. 
Since I want the user to select only one, they all need to have the same
name, let's say 'radioname'....  If they have different names, the user
can select more than one.

Now ideally, I would like to call document.getElementById('radioname')
and have an array of radio button elements returned, but instead all I
get is the first one. 
I am forced into using 
document.formname.elements.radioname[2] etc. 

I think this is a major shortfall with the DOM... so close to being the
best, yet so far away when it comes to radio buttons..   
Unless of course I'm missing something... Am I ?


Tyler Waters
Auxiliary Web Analyst
Ministry of Forests and Range
Revenue Branch
Received on Saturday, 18 March 2006 13:37:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:13 UTC