PDA

View Full Version : how to use onSelect


keithjakins
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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>

<body>
<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>
</select>
<input name="txtDr" type="text" id="txtDr" />
</form>
</body>
</html>