I am trying to change a value of a select field by selecting a value of another field with the help of jquery.
The event fires, but does nothing. Not even return an error:
<select name="attr[8]" id="attr[8]" onchange="$('#attr[5]').val(157);">
<option><!-- some stuff --></option>
</select>
<select name="attr[5]" id="attr[5]">
<option value="">auswählen</option>
<option value="157">Herrenuhr</option>
<option value="11">Damenuhr</option>
</select>
This does not work as well:
<select name="attr[8]" id="attr[8]" onchange="$('#attr\\[5\\]').val('157');">
</select>
Is there a way to change the selected value of the second select box with the html onchange event instead of the jquery "change" event?