Assign a value to selectpicker. I tried to do it like the documentation but it has not worked for me, the point is that I get the options directly from the DB and I want to be able to add an additional option to the records. that is to say that it is like a <option value="0">Seleccione una categoría...</option>
.
$('#idcategoria').selectpicker('val', 'Seleccione la categoría...');
If I put it this way it appears in the first option "Nothing selected", and as I mentioned before I want to appear: Select the category
HTML
<select id="idcategoria" name="idcategoria" class="form-control selectpicker" data-live-search="true" required>
</select>