<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from info_project "
rs.open sqltext,conn,1,1
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
function p_projectno_Change(val)
{
var ProductTxt=document.getElementById("p_product");
var CustomerTxt=document.getElementById("p_customer");
var tAry=val.split('|');
ProductTxt.value=tAry[0];
CustomerTxt.value=tAry[1];
}
</script>
<select name="p_projectno" id="p_projectno" onChange="p_projectno_Change(this.options[this.selectedIndex].value);">
<%do while not rs.eof %>
<option value="<%= rs("product")%>|<%= rs("customer")%>" ><%= rs("projectno") %> </option>
<% rs.movenext
loop%> </select>
<input name="p_product" type="text" id="p_product">
<input name="p_customer" type="text" id="p_customer">
</body>
可以这样写。
老大,成功了。谢谢你。