如何将图中圈红的部分的“output”数据传送到另一个页面,求详细代码,谢谢。
location.href='xxxx.jsp?output='+encodeURLComponent(document.getElementById('output').value)
可以新加一个按钮 如
<input type="button" name="btn" id="btn" >跳转</input>
然后在页面的js里面 写按钮的点击事件
$("#btn").click(function(){
//获取下拉框的值
var vals=$("#output").val()
location.href='xxxx.jsp?output='+vals;
})
重新用一个按钮获取下拉的值
页面接受值的方法
<%
//获得number
String str=request.getParameter("number");
int number=Integer.parseInt(str);
%>
页面接收值的方法
<%
//获得number
String str=request.getParameter("output");
%>
有个select多选插件,样式好看,能清晰的看到自己的选择,你说的传参肯定是需要一个事件去触发它,从而去获取多选的值的
document.getElementById('output').value
1、把 放到form标签下
2、xxx.jsp获取
<%String output = request.getparameter("output");%>