Select List Selection Changes TextBox

[Total: 0    Average: 0/5]

This shows how to have a select list selection update the content of a form text box.

Body Code:

<script language="JavaScript1.2"> 
function verifyInput(_selList,_textBox) {
  var SI = eval(_selList+".selectedIndex");
  var SV = eval(_selList+".options[SI].value");
  eval(_textBox+".value = SV");

<form name=exf1>
<input type=text name=t1 value="default">
<select name="s1" onchange="verifyInput('document.exf1.s1','document.exf1.t1')">
    <option value="v0">Select One</option>
    <option value="v1">V1</option>
    <option value="v2">V2</option>

Times Viewed: 1

Leave a Reply

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