(1)
<% set ItemRs=server.CreateObject("adodb.recordset") ItemSql="select * from Howia_SuggestionSort" ItemRs.open ItemSql,conn,1,3 if ItemRs.eof and ItemRs.bof then Response.Write("暂无信息") else Response.Write("<select name=""SelectItem"" id=""BigID"" style=""200px;"" onchange=""ClassChange(this.value)"">") Response.Write("<option value=""0"" selected>选择大类</option>") do while not ItemRs.eof %> <option id="Sledcom" name="Sledcom" value="<%=ItemRs("BigID")%>"><%=ItemRs("SortName")%></option> <% ItemRs.movenext loop Response.Write("</select>") ItemRs.close set ItemRs=nothing end if %>
(2)
传值 注意隐藏起来
(3)
<script type="text/javascript"> function ClassChange(locationid) { document.getElementById('Keyword').value = document.getElementsByTagName("option")[document.getElementById("SelectItem").selectedIndex].value; } </script>