Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.8, 1.9
-
Fix Version/s: None
-
Component/s: Forms Library
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
If we add the group name to the rendered tags of the groups elements (<div> & <fieldset>), developers can have more control over the display through CSS.
My suggestion is to change line 1399 in formslib.php as follows:
'fieldset'=>"\n\t\t".'<div id="{name}div" class="fitem {advanced}<Unable to render embedded object: File (-- BEGIN required --> required<) not found.-- END required -->"><div class="fitemtitle"><div class="fgrouplabel">{label}<!-- BEGIN required -->{req} <!-- END required -->{advancedimg}</div>{help}</div><fieldset id="{name}fs" class="felement {type} <Unable to render embedded object: File (-- BEGIN error --> error<) not found.-- END error ->"><!- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</fieldset></div>',
This adds the "id" attribute to the containing div and fieldset tags, using the name of the group. Alternatively, the name could be used in the class list if the "id" in not desired.
Issue Links
| This issue duplicates: | ||||
| MDL-31445 | moodleforms unique id on field div wrappers |
|
|
|
Oops, I may just have made a duplicate:
MDL-30204. I was confused by the word 'group' in the summary.Putting name in id won't work, because our names may contain invalid characters like [].
MDL-30204. I was confused by the word 'group' in the summary. Putting name in id won't work, because our names may contain invalid characters like [].