-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.3
-
MOODLE_25_STABLE
-
MOODLE_27_STABLE
-
Easy
-
On the calendar add event screen calendar/event.php?action=new&course=1, in the "duration" section of the form, there are three radio buttons. The choice of radio button enables/disables other form fields that are displayed between the radio buttons.
That's a lovely display for usability, but the radio buttons are added individually using $mform->addElement rather than in a group. When you submit the code of this page to the W3C validator, it reports errors for all but the first radio button.
Error Line 237, Column 59: Duplicate ID fitem_id_duration_0.
…duration_0" class="fitem fitem_fradio"><div class="fitemtitle"><label for="id_…
Warning Line 236, Column 59: The first occurrence of ID fitem_id_duration_0 was here.
This is because the html generated for the radio buttons has not got quite the right id added.
<div class="fitem fitem_fradio" id="fitem_id_duration_0"><div class="fitemtitle"><label for="id_duration_2"> </label></div><div class="felement fradio"><span><input type="radio" id="id_duration_2" value="2" name="duration"><label for="id_duration_2">Duration in minutes</label></span></div></div>
Here you can see that the surrounding div uses id="fitem_id_duration_0" even though the actual form field is id="id_duration_2".
Is it possible to fix the forms library code that generates this html to use the correct outer div id? Or does the form layout need a rethink.