I have a problem when assigning a value to a combo when I show it on my form. The code would be as follows.
//tengo mi función de donde recibo los valores desde otra parte
miFuncion=function(idorden,valor){
$('#idorden').val(idorden);
document.getElementById("s1").value = val(valor);
}
and in the html
<div>
<label for="idorden">Numero de Orden</label>
<input type="text" id="idorden" class="form-control">
</div>
<form id='tambor' >
<select id='s1' >
<option value='1' > opción 1 </option>
<option value='2' > opción 2 </option>
<option value='3' > opción 3 </option>
</select>
</form>
Now, I can see the value of the "idorden" but it does not show me the option of the combo that it should be showing in "s1", and checking in the developer mode in the browser shows me the following error: "Uncaught ReferenceError : val is not defined ".
I thank you in advance for your help. Excellent day.