Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
69
rated 0 times [  74] [ 5]  / answers: 1 / hits: 45249  / 11 Years ago, fri, october 18, 2013, 12:00:00

too add a placeholder in select2 i have to add an empty option tag in the code like this


<select id="e2" name="rol_id" >
<option><option>
{foreach from=$data.roles item=rol}
<option value={$rol.rol_id}>{$rol.rol_nombre}</option>
{/foreach}
</select>

but when i do that i get this option empty that is selectable
enter


how can i not show that option but still the placeholder?


Thanks!


More From » css

 Answers
2

You have a syntax error on 2nd line.



<option></option>

[#74894] Thursday, October 17, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kyrona

Total Points: 422
Total Questions: 111
Total Answers: 97

Location: Oman
Member since Wed, Apr 12, 2023
1 Year ago
;