在第一个页面中通过下拉框选择一个类别:
<select name="select1" id="select1">
<option value="1" id="name" selected="selected">书名</option>
<option value="2" id="author">作者</option>
<option value="3" id="publisher">出版社</option>
<option value="4" id="ISBN">ISBN</option>
</select>
在另一个页面中调用在第一个页面中所选择的类别:
String select2=document.getElementById(request.getParameter("select1"));调不出来啊,问题出在哪里?
<select name="select1" id="select1">
<option value="1" id="name" selected="selected">书名</option>
<option value="2" id="author">作者</option>
<option value="3" id="publisher">出版社</option>
<option value="4" id="ISBN">ISBN</option>
</select>
在另一个页面中调用在第一个页面中所选择的类别:
String select2=document.getElementById(request.getParameter("select1"));调不出来啊,问题出在哪里?
解决方案 »
- 人生规划(Java程序员)
- 好吧!直接问问题!input标签怎么得到图片绝对路径!
- many-to-one 和 one-to-many怎么理解
- eclipse & tomcat 使用问题
- <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
- 请教:jsp声明<%! %>的方法里可不可以连接数据库?
- 问一个HTML关于<pre>..</pre>的问题。
- 从数据库中查询出来的中文字段在action打印出来是乱码
- servlet和jsp经典书籍
- mybatis 一个session里有2条sql,但每次都只执行了第一句sql
- 文本框中 插入的表情图片如何判断为空
- 在js中怎样向数据库插入页面的结束时间 ?
你知道这句话的意思不?
==String select2=document.getElementById("1");
String select2 = request.getParameter("select1");
用js获取,你就要把这个获取到的值设在第二个页面上。然后再用js获取:
如<div id="select2">${select1}</div>
var select2 = document.getElementById("select2").innerHTML;
out.println(select2);
显示的结果为null,说明调用不成功啊,为什么呢?