Select List Label Retriever

[Total: 0    Average: 0/5]

This example shows how to pick off a selected list’s chosen values.

Body Code:

<script>
function goGetThem()
{
  var _$f0=document.exf0;
  var _$f1=document.exf1;
  var _$f2=document.exf2;
  var _f1=_$f1.sel.options[_$f1.sel.selectedIndex].text;
  var _f2=_$f2.sel.options[_$f2.sel.selectedIndex].text;
  _$f0.t1.value=_f1;
  _$f0.t2.value=_f2;
}
</script>
<form name=exf0>
Form1:<input type=text name=t1>
<BR>
Form2:<input type=text name=t2>
<BR>
<input type=button onclick="goGetThem()" value="Go Get The Selected Values">
</form>

<form name=exf1>
<select name=sel>
<option selected>Select One</option>
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
</select> 
</form>

<form name=exf2>
<select name=sel>
<option selected>Select One</option>
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
</select> 
</form>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *