Find jobs - Just Holden Commodores - Property in Germany - Deaf Topics - Free Credit Report

PDA

View Full Version : change textbox on change of dropdown


mmelen
Jul 2nd 2008, 11:07 pm
I want there to be 2 choices of dropdown.
For example sake, "YES" and "NO".
When "YES" is chosen, I want the initial value of the textbox to be "YEA!" and if "NO" is chosen, then the value of the textbox is "OH NO!"

How do I do that?

thanks in advance!

Vooler
Jul 3rd 2008, 12:26 am
Pretty simple.


<select onChange="javascript:document.getElementById('msg').value=this.value">
<option value="Select one option">Select</option>
<option value="OH YEA">YES</option>
<option value="OH NO">NO</option>
</select>

<input id="msg" name="msg" type=text size=20>

I hope it helps.

regards