I have a select with a single fixed option disabled, the other options are added after an ajax query, I need to load the page to select the fixed option with the disable.
<select id="desdeReserveInput" name="desde" class="form-control">
<option value="lugar" selected disabled>Lugar</option>
</select>
Here is the jquery that adds the other options:
lugares.forEach(function (item) {
var desdeOption = document.createElement('option');
desdeOption.value = item['nombre'];
desdeOption.innerHTML = item['nombre'];
desde.appendChild(desdeOption);
});
Again, the only difficulty I have is that when the page is loaded the first option that I added with jquery is automatically selected.