+ -
当前位置:首页 → 问答吧 → asp階層下拉是選單,為什麼text的值不見了...

asp階層下拉是選單,為什麼text的值不見了...

时间:2011-07-14

来源:互联网

HTML code

<html> 
<head><title></title></head> 
<body> 

<input type="text" name="a1" maxlength='10' size="10" >→→为什么这边,当点选count完以后,页面就会自动重新整理,user输入的值就不见了
<select size="1" name="count" onchange="location.href='a.asp?count='+this.value;"> 
    <option value="0"  <%if request("count")="0" then response.write " selected"%>>全部</option> 
    <option value="1"  <%if request("count")="1" then response.write " selected"%>>北部</option> 
    <option value="2"  <%if request("count")="2" then response.write " selected"%>>中部</option> 
    <option value="3"  <%if request("count")="3" then response.write " selected"%>>南部</option> 
</select> 
     
<% '資料庫連結(略) 
    coun = request("count") 
     if coun = 0 then 
        sel1 = " select cno, cname from citty"  '依count点选不同的值,而改变citty下拉是选单的内容 
     end if 
     if coun = 1 then 
        sel1 = " select cno, cname from citty where no = '1' "  '依count点选不同的值,而改变citty下拉是选单的内容
     end if 
     if coun = 2 then 
        sel1 = " select cno, cname from citty where no = '2' "  '依count点选不同的值,而改变citty下拉是选单的内容
     end if 
     if coun = 3 then 
        sel1 = " select cno, cname from citty where no = '3' "  '依count点选不同的值,而改变citty下拉是选单的内容
     end if 
     rs.open sql1,conn_2,3,3,1  

     response.write "  <select name='citty' >" 
     response.write "  <option selected value='0'>ALL</option>" 
     DO WHILE NOT RS.EOF 
     response.write "  <option value='" & rs("cno") & "'>" & rs("cname") & "</option> " 
        rs.movenext 
     loop 
     response.write  " </select>"  
%>      
</body> 
</html> 




请问为什么当我点选完count以后,页面自动重新整理...text的输入过的值就不见了,我该如何让他在自动重新整理后值还可以呈现在text中?

请指导一下

作者: kiken10   发布时间: 2011-07-14

session("a1")=request("a1")
<input type="text" name="a1" maxlength='10' size="10" value="<%=session("a1")%>">

作者: yaxiya   发布时间: 2011-07-14

他还是一样
<%session("a1")=request("a1")%>
<input type="text" name="a1" maxlength='10' size="10" value="<%=session("a1")%>">

是这样吗??

为什么在系统自动重新整理后,他还是会不见呢?

作者: kiken10   发布时间: 2011-07-14