Hi guys, I try to extend the selectize form field, i need to add a simple class to a selectize-input item or directly in the option of the select but if i try to do that in the “forms/fields/select/select.html.twig”
<option
{% if key == value or (field.multiple and selected in value) %}
selected="selected"
{% endif %}
class="error"
value="{{ item_value }}"
>
{% if grav.twig.twig.filters['tu'] is defined %}
{{ text|tu|raw }},{% else %},{{ text|t|raw }},{% endif %}
</option>
I always have this result in the html
<option value="20701AA005" selected="selected">20701AA005</option>
the class was erased!
I need to show a different backgroud color based on condition, i’ve alredy write the condition check but i’m unable to add this class.
Anyone have suggestions?
Thanks