1
In the following example I take the value of the description in Alert; I need to take this text from the drop-down box in the value of an input field... how to adapt this? I have to send this description via post! Obs: I don’t want to send the value of the combobox but the value selectedIndex, I hope you understood.
<script>
function desc(){
var i = document.form2.cb.selectedIndex;
alert(document.form2.cb[i].text);
}
</script>
<form name="form2">
<select name="cb" onchange="desc()">
<option value="1">VERDE</option>
<option value="2">AMARELO</option>
<option value="3">AZUL</option>
<option value="3">BRANCO</option>
</select>
</form>