首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2012-02-10 
URL传文本框的值trtdinputname password type text value %user.getPassword()%size

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事件触发就行了

热点排行