mpartarrieu
Programmer
Hi all,
I've written this javascript function that populates a textfield when an option is selected from a dropdown menu. It works fine in IE, but nothing happens using firefox.
Here's the function:
And here's the form I'm calling the function from:
Any ideas??? TIA
I've written this javascript function that populates a textfield when an option is selected from a dropdown menu. It works fine in IE, but nothing happens using firefox.
Here's the function:
Code:
function update_it(valor,referencia)
{
var m = document.getElementById(referencia);
m.value = valor.options[valor.selectedIndex].value;
}
And here's the form I'm calling the function from:
Code:
<form action="actiob.php" method="post" name="formulario">
<input type="text" name="text_1" value="" size="5" />
<br /><br />
<select name="change_text_1" id="change_text_1" onchange="update_it(this,'text_1')">
<option value=""></option>
<option value="1">Value 1</option>
<option value="2">Value 2</option>
<option value="3">Value 3</option>
<option value="4">Value 4</option>
</select>
</form>
Any ideas??? TIA