站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2EE 专题JSP如何获取文本框内容

JSP如何获取文本框内容

摘要: JSP如何获取文本框内容


<form name="form1" action="indentlist.jsp" method="POST" >
<input type="text" name="orderid" size="12" maxlength="20">
<%String str = document.form1.orderid.value;%> //如何获得文本框内容,这里有错
<input name="Submit" type="button" value="查找" onClick=" openScript('indentlist.jsp?indentid=<%=str%>','indent',500,500)" >
</form>


在indentlist.jsp里边:request.getParameter("orderid");




<%String str = document.form1.orderid.value;%>
JSP中直接调用js的对象??你这样好象不行吧.

看代码不明白楼主什么意图~~


对,用request.getParameter("orderid");


上面说的方法我也会,现在是在网页不提交的情况下得到文本框内容,
只有提交JSP网页,才能得到request,如果不提交能得到吗


服务器端不可以访问客户端脚本里的内容呢


javascript可以得到的


↑返回目录
前一篇: 关于struts的再贴(在此感谢上次热心帮助我的高人们,也希望高人们再次热心指点)
后一篇: (讨论)关于pojo、dao、service的困惑