请大家帮帮忙 我选择想做一个这样的功能:一个页面(a.jsp)就是有一个文本框,文本框后面有一个查询按钮。点击查询跳到另外一个页面(b.jsp),b.jsp页面有很多html:multibox 选框的选项 ,选择一项点确定后把选择的内容添加到a.jsp页面的那个文本框里。不知道谁有这方面的例子或 代码。给我参照一下,谢谢大家帮帮忙了。等着急用!!!
解决方案 »
- 急求jsp+MySql网站信息发布系统
- jsp的传递中文参数混乱问题。希望各位大拿帮忙解决一下啊
- 请求推荐Struts2,Hibernate,Spring方面的经典入门书籍
- jsp里表格分页
- 如何通过地址栏传递url
- 能否让从服务器端获得的时间(精确到秒)动起来?
- 如何将本地文件写入一个inputstream
- 中秋快乐!帮忙分析一下了,为什么还会出现"Cannot start Java debug process VM"
- 在调试时如何打印出一个完整的SQL语句?
- 关于tomcat4.0中设置Servlet应用程序控
- 在一个jsp页面进行某个字段删除等操作?
- mysql CachedRowSetImpl
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head><body>
<form id="form1" name="form1" method="post" action=""> <input type="text" name="Text" /> <a href="b.html" target="_blank">b.html</a></form></body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title><script type="text/javascript" language="javascript">function test(){window.alert('操作成功!');
window.opener.document.form1.Text.value="test";window.close(this);
}
</script></head><body>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="checkbox" name="checkbox" value="checkbox" />
</label>
<label>
<input type="checkbox" name="checkbox2" value="checkbox" />
</label>
<label>
<input type="button" name="button" onclick="test()" value="提交" />
</label>
</form>
</body>
</html>
我只是把数据从B.HTML写回A.HTML的文本筐里,具体要怎么样,你自己应该知道怎么做了
<script language="javascript">
function test(my){
alert(my);
}
function ttt(){
alert('开始调用');
myframe.document.forms['form1'].button1.onclick();
myframe.document.forms['form1'].submit();
}
</script>
<body>
<br>ppp
<br>
<br>
<iframe src="includehtml.html" id="myframe">
</iframe> <br>
<br>
<br>
<input type="button" value="调用子窗体按钮的事件" onclick = "javascript:ttt()">
</body>
</html>
<body>
<form id = "form1" action = "dd.htm">
<input type="button" id="button1" value="引用" onclick="parent.test('我是谁')">
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head><body>
<form id="form1" name="form1" method="post" action=""> <input type="text" name="Text" /> <a href="b.html" target="_blank">b.html</a></form></body>
</html>b.html<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title><script type="text/javascript" language="javascript">function test(){window.alert('操作成功!');
window.opener.document.form1.Text.value="test";window.close(this);
}
</script></head><body>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="checkbox" name="checkbox" value="checkbox" />
</label>
<label>
<input type="checkbox" name="checkbox2" value="checkbox" />
</label>
<label>
<input type="button" name="button" onclick="test()" value="提交" />
</label>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head>
<%
String value = request.getParameter("a");
if(value == null){
value = "";
}
%>
<body>
<form id="form1" name="form1" method="post" action=""> <input type="text" name="Text" value="<%=value%>"> <a href="b.html" target="_blank">b.html</a></form></body>
</html>
b.jsp<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title><script type="text/javascript" language="javascript">function test(){window.alert('操作成功!');
window.form1.submit();
window.close(this);
}
</script></head><body>
<form id="form1" name="form1" method="post" action="a.jsp">
<label>
<input type="checkbox" name="a" value="111" />
</label>
<label>
<input type="checkbox" name="a" value="222" />
</label>
<label>
<input type="button" name="button" onclick="test()" value="提交" />
</label>
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""> <script language="javascript"> </script>
</HEAD> <BODY>
<textarea id="text" cols="10" rows="5"></textarea>
<input type="button" value="open" onclick="window.open('2.html')"/>
</BODY>
</HTML>
2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
function change() {
var str = "";
var arr = document.forms[0].elements;
for (var i = 0;i<arr.length;i++ )
{
if (arr[i].checked)
{
str += arr[i].value+"\r\n";
}
} window.opener.document.getElementById("text").value = str;
}
</script>
</HEAD> <BODY>
<form>
<input type="checkbox" name="chk" value="a"/>a
<input type="checkbox" name="chk" value="b"/>b
<input type="checkbox" name="chk" value="c"/>c
<input type="checkbox" name="chk" value="d"/>d
<input type="checkbox" name="chk" value="e"/>e
<input type="checkbox" name="chk" value="f"/>f
<input type="checkbox" name="chk" value="g"/>g
</form>
<input type="button" value="changeValue" onclick="change()"/>
</BODY>
</HTML>