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
how can i not show that option but still the placeholder?
Thanks!
style="display:none;"
? – Leaseholder