做一个效果,请求高手,php,ajax,jsp,请高手帮忙
- 提问者网友:我的未来我做主
- 2021-05-17 03:08
- 五星知识达人网友:duile
- 2021-05-17 04:22
父页面:
<html>
<head>
<title>无标题页</title>
</head>
<body>
<select name="s1" id="s1" onchange="javascript:window.open(this.options[this.selectedIndex].value)">
<option value="child.html" selected="selected">text1</option>
<option value="child.html">text2</option>
<option value="child.html">text3</option>
</select>
<input id="returnvalue" type="text" />
</body>
</html>
子页面child.html
<html>
<head>
<title>无标题页</title>
<script type="text/javascript">
function rvalue()
{
var returnvalue = "";
var cb = document.getElementsByName("cb");
for(var i=0;i<cb.length;i++)
{
if(cb[i].checked)
{
returnvalue += cb[i].value + ",";
}
}
returnvalue = returnvalue.substring(0,returnvalue.length-1);
window.opener.document.getElementById("returnvalue").value = returnvalue;
window.close();
}
</script>
</head>
<body>
<input name="cb" type="checkbox" value="1"/>1<br />
<input name="cb" type="checkbox" value="2"/>2<br />
<input name="cb" type="checkbox" value="3"/>3<br />
<input id="Button1" type="button" value="button" onclick="rvalue();"/>
</body>
</html>