jsp中的文本框是通过js赋值,怎么把这个值传给action? 文本框中显示的值是通过js获得的,document.getElementById("show").value = newValue;怎么把这个值传给action,小弟刚学,请各位大神们帮忙。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.getElementById("show").value = newValue; 不是放在show里了 在action里直接用request.getParameter("show")取啊 通过表单提交到后台action比如:<div id="operation"> <html:form action="/fe185"> <input type="text" name="_opCode" value=""> <input type="submit" value="提交"></html:form><div>后台可以通过String str = request.getParameter("opCode");获取 System.out.println("==="+ServletActionContext.getRequest().getParameter("show"));取不到值啊。 楼主你好,可以有两种方法,第一种在页面写一个隐藏元素把document.getElementById("show").value = newValue;如 <input type="hidden" name="show" value="newValue"/>这样show就有值了,到了action中就可以request.getParmeter("show")就可以取到,有一点要注意要把隐藏元素放到form表单中第二种: 可以放到要跳转的action的后边如xx.do?show=newValue同理去action也可以用request.getParmeter("show")来取值 js里得到值 var test = document.getElementById("").value document.forms[0].action = "***.action?test="+test document.forms[0].submit;request里就可以拿到了 你是把值放在了一个id="show"的html标签里了,而后台request.getParaeter("show")取值是取的name="show"的html标签的值;你可以这样<form action="" method="post"><input type="text" id="show" name="show"/><input type="submit"/></form>你试下吧; 给你个例子method = "post";action = "order.do?order_time="+document.getElementById("order_date").value+"&delivery_date="+document.getElementById("delivery_date").value+"&check_status="+document.getElementById("state").value;submit();直接把参数放到action中传过去在后台request.getP…… 接受! window.open("printerout.action?newValue="+newValue)后台对你的控件用getter setter方法 jsp 读取页面参数中文为乱码啊 java poi3.0 实现excel的工作簿保护 求一个字符串处理的解决方法,在线求助 不太好解决的问题 请问高手有没有什么好的防止网页内容被复制的方法 我从网上找了一个统计在线用户的源码,如果我在客户端登陆以后,怎么得到我登录的用户名,急啊! 100分,如何安装sturts?解决马上送分 求助,关于打印的问题!! 关于SpringMVC servlet里的session.setAttribute();转发后得不到值。求大牛 red5 录像和播放问题 tomcat+jsp+mysql+c3p0这几个什么关系
在action里直接用request.getParameter("show")取啊
<div id="operation">
<html:form action="/fe185">
<input type="text" name="_opCode" value="">
<input type="submit" value="提交">
</html:form>
<div>
后台可以通过String str = request.getParameter("opCode");获取
取不到值啊。
document.getElementById("show").value = newValue;
如 <input type="hidden" name="show" value="newValue"/>这样show就有值了,到了action中就可以request.getParmeter("show")就可以取到,有一点要注意要把隐藏元素放到form表单中
第二种:
可以放到要跳转的action的后边如xx.do?show=newValue
同理去action也可以用request.getParmeter("show")来取值
你可以这样
<form action="" method="post">
<input type="text" id="show" name="show"/>
<input type="submit"/>
</form>
你试下吧;
action = "order.do?order_time="+document.getElementById("order_date").value+"&delivery_date="+document.getElementById("delivery_date").value+"&check_status="+document.getElementById("state").value;
submit();直接把参数放到action中传过去
在后台request.getP…… 接受!
后台对你的控件用getter setter方法