Hi Guys,
I have been trying to figure out how to display values from these two select forms, all to no avail. I’m just a novice in coding anyways. Your help is highly appreciated..
Below is what I have done to get it working but no luck…
<script type=”text/javascript”>
function firstResult()
{
var x=document.getElementById(“first”).selectedIndex;
//alert(document.getElementsByTagName(“option”)[x].value);
var objHidden = document.getElementById(“frstHidden”);
objHidden.value = document.getElementsByTagName(“option”)[x].textContent;
}
function secondResult()
{
var y=document.getElementById(“second”).selectedIndex;
//alert(document.getElementsByTagName(“option”)[y].value);
var obj2Hidden = document.getElementById(“scndHidden”);
obj2Hidden.value = document.getElementsByTagName(“option”)[y].textContent;
}
</script>
<!– form 1 –>
<form>
<select name=”amount” style=”width:250px;font:9px;margin-top:4px” id=”first” onchange=”firstResult()”>
<option>–Select Course–</option>
<option value=”a”>A</option>
<option value=”b”>B</option>
</select>
<input type=”text” name=”” id=”frstHidden” value=””/>
</form>
<!– end of form 1–>
<!– form 1 –>
<form>
<select name=”amount” style=”width:250px;font:9px;margin-top:4px” id=”second” onchange=”secondResult()”>
<option>–Select Course–</option>
<option value=”c”>C</option>
<option value=”d”>D</option>
</select>
<input type=”text” name=”” id=”scndHidden” value=””/>
</form>
<!– end of form 2->