读书人

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

发布时间: 2012-02-10 21:27:41 作者: rapoo

URL传文本框的值

<tr>

<td> <input name= "password " type= "text " value= " <%=user.getPassword()%> " size= "7 "/> </td>
<td> <a href= " <%=request.getContextPath()%> /xiugai.do?method=xiugaiUser&userId= <%=user.getId()%> &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事件触发就行了

读书人网 >Java Web开发

热点推荐