Wednesday, March 7, 2007

Radio buttons as spans

Hi all. Becky and I were the only ones on the call today. Thanks Becky for answering lots of questions!

I just want to note something... think aloud a little more if you don't mind... about radio button groups in dojo. As it stands now radio buttons are spans (attached as "domNode") with a div node (attached as "imageContainer") and a hidden input node (attached as "inputNode"). The div node represents visually the dojo checkbox. The attach points are not really relevant but I like to remind myself as I'm still a noob.

Here is a screenshot of dijit/tests/form/test_Checkbox.html with firefox and firebug.

I think (and I hope to confirm tomorrow) that the fact we don't have visible input nodes with name attributes means that we are losing the otherwise "free" access to "group" (grouping by name) information that browsers glean with regular radio input elements.

One solution might be to expose the hidden input name attribute by adding a name attribute (hmmm is that a standard attribute?) to the (non-hidden) span element (also known as the domNode). We could make sure that browsers check the name attribute for grouping purposes for any element with wairole that is form-element-ish (like a wairole of "radio").

We should definitely ping Aaron on this when he's around.

Scratching my head...

1 comment:

David Bolter said...

Note the span id attribute comes close to what we might need.