<script>
function az(str)
{
window.document.getElementById('d1').innerHTML+=str.value}</script><select onchange=az(this) id=s1 name=s1>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select><div id="d1">
</div>

解决方案 »

  1.   

    <script>
    function gotourl(obj)
    {
    self.location=obj.value}</script>
    <select name="sort0" id="select3" onChange="javascript:gotourl(this)" >
    <option value="" selected>選擇主項 </option>
    <% if not first.eof then
    while not first.eof
    %>  
      
    <option  value="index.asp?sort0=<%=first("mainsort")%>""<%=first("mainsort")%>"><%=first("mainsort")%></option><%first.movenext
    wend
    first.Close()
    set first=nothing
    end if
    %></select>
      

  2.   

    <select name="sort0" id="select3" onChange="javascript:self.location=this.options[this.selectedIndex].value" >
    <option value="" selected>選擇主項 </option>
    <% if not first.eof then
    while not first.eof
    %>  
      
    <option  value="index.asp?sort0=<%=first("mainsort")%>"><%=first("mainsort")%></option><%first.movenext
    wend
    first.Close()
    set first=nothing
    end if
    %></select>