Ticket #37 (new defect)
Generated Radio Button elements have identical IDs
| Reported by: | clay@… | Owned by: | pmjones |
|---|---|---|---|
| Priority: | major | Component: | code |
| Keywords: | Cc: |
Description
Radio button elements have identical CSS ids, which violates the "ids must be unique" rule of XHTML.
<?php $form->elements['foo[bar]']['type'] = 'radio'; $form->elements['foo[bar]']['options'] = array( 1 => $this->locale('RADIO_YES'), 0 => $this->locale('RADIO_NO'), ); ?>
Will result in something similar to:
<label><input type="radio" name="foo[bar]" value="1" id="foo-bar" class="input-radio foo-bar require" />Yes</label> <label><input type="radio" name="foo[bar]" value="0" id="foo-bar" class="input-radio foo-bar require" checked="checked" />No</label>
For XHTML that will validate, the output should probably be something similar to:
<label><input type="radio" name="foo[bar]" value="1" id="foo-bar-1" class="input-radio foo-bar require" />Yes</label> <label><input type="radio" name="foo[bar]" value="0" id="foo-bar-2" class="input-radio foo-bar require" checked="checked" />No</label>
(I'd make this little change myself, but I'm not sure of the state of the current trunk vs. branch.)
Attachments
Note: See
TracTickets for help on using
tickets.
