javascript
function test(abc) {
var ddlArray = new Array();
var ddl = document.getElementById('AdjusterList');
for (i = 0; i < ddl.options.length; i++) {
ddlArray[i] = ddl.options[i].value;
}
var indexsel = ddl.selectedIndex;
return indexsel ;
}
ASP
strArrayCRN = osRecordSet.RecordCount
strArrayCRN2 = osRecordSet2.RecordCount
dim StrCount
StrCount =strArrayCRN+strArrayCRN2
HTML +ASP
<select name="AdjusterList" id="AdjusterList" onchange='test("<%=StrCount%>")'><%
%>
<option value="0">Please choose an option from the list.</option>
<% Do While (osRecordSet.EOF = False)
%><option value="<%=osRecordSet.RowPosition%>">
<%=osRecordSet.Fields("NAME")%></option>
<%
osRecordSet.MoveNext
Loop %><%
Do While (osRecordSet2.EOF = False)
%><option value="<%=osRecordSet2.RowPosition%>">
<%=osRecordSet2.Fields("NAME")%></option>
<% osRecordSet2.MoveNext Loop %>
在这里,我想将函数 test() 的返回值,即所选索引的值传递给 asp 服务器端