W3C home > Mailing lists > Public > public-html-comments@w3.org > March 2010

Re: Equivalent of RadioNodeList for checkboxes

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 15 Mar 2010 21:17:13 +0000 (UTC)
To: Anurag Mishra <anurag@appwhirl.com>
Cc: public-html-comments@w3.org
Message-ID: <Pine.LNX.4.64.1003152116340.10462@ps20323.dreamhostps.com>
On Fri, 12 Mar 2010, Anurag Mishra wrote:
> 
> Recently a question regarding best practices for getting input radio 
> elements was posted on StackOverflow.com at 
> http://stackoverflow.com/questions/2437190/best-practice-accessing-radio-button-group.. 
> I tried to lookup the specs and saw that a RadioNodeList interface has 
> been defined. The spec says that when accessing an HTMLFormsCollection 
> with the namedItem method, a RadioNodeList object is returned if 
> multiple elements are matched with same names.
> 
> interface RadioNodeList : NodeList {
>          attribute DOMString value;
> };
> 
> However, this seems to deal specifically with radio input elements. The 
> RadioNodeList interface defines an attribute value which is a DOMString. 
> Is there a similar interface for checkbox elements and their collection 
> that provides access to values of all elements that are checked?

Not currently. You can either check the checkboxes by index, or use 
different names for each checkbox.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 15 March 2010 21:17:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:14:01 GMT