Search code examples
javascriptmaterialize

Materializecss 2.0.1 : problem with Label in Selects


Im using Materializecss 2.0.1 and the in the select dissapear. My code: <select required class="validate" name="id_provincia" id="id_provincia"> <option value="" disabled selected>Sel. una opción</option> <?php foreach ($data[list_provincias] as $k=>$prov){ ?> <option <?php if($prov[id]==$data['record']['id_provincia']){ echo "selected='selected' "; }elseif($prov[id]=='22' && !$data['record']['id_provincia']){ echo "selected='selected'"; } ?> value="<?php echo $prov[id]; ?>"><?php echo $prov[provincia]; ?></option> <?php } ?> </select> <label for="id_provincia">Provincia</label> <span class="helper-text">Sel. Provincia</span>

enter image description here

Im try copy and pastle the example, erease all includes (except materializecss) and still the bug. "Materialize Select" is the label. This is a example in the official doc - https://materializeweb.com/select.html


Solution

  • Ok, im find the bug.

    If you initialize a and initialize again the label tag dissapear.