解决方案 »

  1.   

    <td><input type="button" onClick="javascript:location.href='test.asp?a=<%=rs(\"a\")%>&b="+ document.getElementById('b').value+"'" value="cc"/></td>
      

  2.   

    <%=rs(\"a\")%> 报语法错误改为 "javascript:location.href='test.asp?a=<%=rs("a")%>&b="+ document.getElementById('b').value+"'"报未结束字符串常量
      

  3.   

    <input type="button" onClick='javascript:location.href="test.asp?a=<%=rs(\"a\")%>&b="+ document.getElementById("b").value' value="cc"/>
      

  4.   


          <td ><input  id="b" class="Wdate" onfocus="WdatePicker({maxDate:'%y-%M-#{%d+30}',    minDate:'%y-%M-#{%d}'})" /></td>
          <td ><input type="button" onClick='javascript:location.href="lend.asp?a=<%=rs("a")%>&b=" + document.getElementById("b").value; ' value="cc"/></td>这么写法是不报错误的,但 input b中默认为空,加入值的时候,传递时获取不到
      

  5.   

    测试页面,可以得到输入值
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script>
    </script>
    </head>
    <body>
    <input type="button" onClick='javascript:location.href="test.asp?a=<%=rs(\"a\")%>&b="+ document.getElementById("b").value' value="cc"/>
    <input type="text" id="b" />
    </html>
      

  6.   


    我不是html页面,是asp的页面
      

  7.   

    我估计到原因了,我那有循环,id='b' 出现了多次造成获取不到值
      

  8.   

    好像是这样<%=rs(&a&')%>
      

  9.   

    <%=rs(&a&)%>   多了个点。。 刚刚