View Full Version : how to use onSelect

06-08-2005, 03:45 AM
I am trying to get the select value of the listbox to appear in a textbox when the listbox item is selected.
Any help would be greatly appreciated

Here is my code

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


<form name="form1" method="post" action="">
<select name="lbd" size="2" id="lbd"onSelect="javascript document.form1.txtDr=document.form1.lbd.value">
<option value="v1">1</option>
<option value="v2">2</option>
<option value="v3">3</option>
<input name="txtDr" type="text" id="txtDr" />