当前位置: 代码迷 >> Java Web开发 >> URL传文本框的值,该如何解决
  详细解决方案

URL传文本框的值,该如何解决

热度:64   发布时间:2016-04-17 14:07:08.0
URL传文本框的值

<tr>

<td> <input   name= "password "   type= "text "   value= " <%=user.getPassword()%> "   size= "7 "/> </td>
<td> <a   href= " <%=request.getContextPath()%> /xiugai.do?method=xiugaiUser&amp;userId= <%=user.getId()%> &amp;password= "+password+ "> 修改 </a> </td>
</tr>

------解决方案--------------------
用js.
var password = document.getElementByTagName( "password ")[0].
或者var password = document.getElementById( "password ");(给password定义个id-- "password ");
然后就用document.URL = " <%=request.getContextPath()%> /xiugai.do?method=xiugaiUser&userId= <%=user.getId()%> &password= "+password;
修改上面就用onclick事件触发就行了
  相关解决方案