I have a dropdown form that I have created - I need to have the dropdown either be auto-generated to a text box once selected or have it placed in the text box once a button has been pressed. For example "Get Hex"
Here is my dropdown:
<fieldset>
<legend>Logos</legend>
<p>
<label>Choose Desired Logo</label>
<select id = "Logo">
<option value = "00">Holden</option>
<option value = "01">HSV</option>
<option value = "02">Chevrolet</option>
<option value = "02">Chevrolet</option>
<option value = "04">CSV</option>
<option value = "05">Pontiac</option>
</select>
<input type="button" value="Show Hex" onclick="displaySelectedItem(val);" />
</p>
<p>
<input type="text" id="Logo" />
</p>
</fieldset>
And here is the last JS script i've tried. I have tried a few but I am surely missing something as nothing I command works.
<script language="JavaScript" type="text/javascript">
<!--
function displaySelectedItem(val)
{
alert(val);
}
//-->
</script>
So I need for the text box to contain the hex code in the <option value = "##">
I'll be using this throughout 6 different forms, all needing the same thing.