Thanks in advance.
I want to change the value of input text "total" in a form depending the value of the select "opciones". I tried with onchange(), with document.getElementById("").value but it doesn't works.
I dont know what is failing, but I cannot change the input value.
<form name="formulario">
<select name="opciones" id="opciones">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<input type="text" name="suma" id="total">
</form>
Javascript:
function formtotal() {
if (document.formulario.opciones.value = "1") {
document.formulario.suma.value = "1000";
}
else if (document.formulario.opciones.value = "2") {
document.formulario.suma.value = "1250";
}
else if (document.formulario.opciones.value = "3") {
document.formulario.suma.value = "1500";
}
}