form_dropdown() |
Hi all,
Does anyone know is there is a way to place additional attributes to the option tag in a Select dropdown, using the form_dropdown() form helper? I am trying to achieve a out put like this Code: <select class="floating-select" name="tam_day_label" id="tam_day_label" onclick="this.setAttribute(\'value\', this.value);" value=" " required/> my current form dropdown (select) is compiled like below: Controller PHP Code: $dayArray=[ PHP Code: <?= form_dropdown('tam_day_label', $dayArray, old('tam_day_label'), $dayType_tags); ?> Output Code: <select class="floating-select" name="tam_day_label" id="tam_day_label" onclick="this.setAttribute(\'value\', this.value);" value=" " required/> Many thanks. |
Messages In This Thread |
form_dropdown() - by 68thorby68 - 11-03-2021, 03:53 AM
RE: form_dropdown() - by includebeer - 11-05-2021, 03:23 PM
RE: form_dropdown() - by 68thorby68 - 11-09-2021, 04:32 PM
|