<select size=5 MULTIPLE>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
<input>
<script>
var sel=document.all.tags("SELECT")[0];
var txt=document.all.tags("INPUT")[0];
sel.ondblclick=function(){txt.value=txt.value+sel[sel.selectedIndex].value+"|"}
</script>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
<input>
<script>
var sel=document.all.tags("SELECT")[0];
var txt=document.all.tags("INPUT")[0];
sel.ondblclick=function(){txt.value=txt.value+sel[sel.selectedIndex].value+"|"}
</script>
要做两个页面:
第一个html:test.htm<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="" method=post name=form1>
<tr>
<td width="39%" align="right">姓名:</td>
<td width="3%"> </td>
<td width="58%"><input type="text" name="strTrueName">
<a href="#" onClick="javascript:window.open('choose_name.htm','choose_name','height=250,width=300,scrollbars=yes,resizable=yes')">请选择</a></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</form>
</table>
</body>
</html>第二个html:choose_name.htm<html>
<head>
<title>
选择客户名称
</title>
<script language = "javascript">
function close1(name){
opener.document.forms["form1"].elements["strTrueName"].value=name;
window.close();
}
</script>
</head>
<body>
<form method="post" action="choose_name.htm" name = "form1">
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="28%" align="center">客户名称 </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="100%">
<select NAME="strName" size="5" multiple>
<option value="张">张</option>
<option value="王">王</option>
<option value="李">李</option>
<option value="赵">赵</option>
<option value="吴">吴</option>
</select>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="20%" align="left">
<input TYPE="button" NAME="Submit" VALUE="确定" onclick="close1(form1.strName.value)"></td>
<td width="70%">
<input TYPE="RESET" VALUE="重置"> </td>
</tr>
</table>
</form>
</body>
</html>