enum form type, label not closing
Came across an issue with the form module, whereby the label's for enum field types weren't being closed. Traced the issue to fuel library form_builder.php. Created a pull request for it, but not sure it won't cause additional issues.
Cheers
Comments
We have an issue styling forms with enum fields as the select is in the label tag. And if we correct the html then the select options don't appear till the label has been clicked which is no good for users.
Any idea's?
array (
'department' =>
array (
'type' => 'enum',
'name' => 'department',
'label' => 'Department',
'attributes' => 'class=\'wrapper\'',
'options' =>
array (
'general' => 'General',
'test_drive' => 'Test Drive',
'reserve' => 'Reserve',
'video' => 'Request a Video',
),
'block_name' => 'enum',
),
......
)
and the generated HTML for the field:
<label for="department" id="label_department">Department <p> <select name="department" id="department" class="wrapper"> <option value="General" label="General">General</option> <option value="Test Drive" label="Test Drive">Test Drive</option> <option value="Reserve" label="Reserve">Reserve</option> <option value="Request a Video" label="Request a Video">Request a Video</option> </select> </p> </label>
Thanks
when using a select form type and adding before_html and after_html to the type, the form field doesn't render the options until you click on the label.
here's the array:
array (
'department' =>
array (
'type' => 'select',
'name' => 'department',
'label' => 'Department',
'attributes' => 'class=\'wrapper\'',
'options' =>
array (
'general' => 'General',
'test_drive' => 'Test Drive',
'reserve' => 'Reserve',
'video' => 'Request a Video',
),
'block_name' => 'select',
'before_html' => '
'after_html' => '
),
....
)
and the html:
<div class="department"> <label for="department" id="label_department">Department</label> <p></p><div class="styled-select"><select name="department" id="department" class="wrapper"> <option value="general" label="General">General</option> <option value="test_drive" label="Test Drive">Test Drive</option> <option value="reserve" label="Reserve">Reserve</option> <option value="video" label="Request a Video">Request a Video</option> </select> </div><p></p> </div>
But, when the select type rendered it wasn't showing any options. The first would appear when you clicked on the label, then you have to click on the control again to view the list.