chosen.js so that all my
<select> tags are plain HTML, but am so far unable to change the default class of
inputbox to one of my choosing,
(specificially from the Search Tools filters of my component page).
I've looked at a number of answers and tutorials about overriding forms, but I'm either not understanding the examples, or looking at the wrong kind of overrides.
Ultimately, I want to change the class of any
<select> that is generated in
libraries\cms\html\select.php. I've tried adding the path/file to my template, but can't get that to do it. I see that it's generating the field with
$options as below, but I can't figure where THAT is being determined and supplied.
$options Array ( [format.depth] => 0 [format.eol] => [format.indent] => [id] => filter_event_group_id [list.attr] => class="inputbox" onchange="this.form.submit()" [list.translate] => [option.key] => value [option.text] => text [list.select] => )
My attempts at specifying it in the XML at List form field type are failing as well - the page just comes up blank, though that was a shot in the dark because my field is actually a SQL Form Field Type which apparently does NOT support the Class parameter like the Select does.
<field name="created_by" class="MyChosenClassname" type="sql"...`
So, the question is either how do I add this override to my template properly, or how do I specify the Class name to be used in the generated
You should just be able to add the
class attribute to the XML field, like so:
<field name="foo" class="MYCLASS" type="list" label="My List"> <option value="0">Option 1</option> <option value="1">Option 2</option> </field>