怎么从一个jsp 页面 取值 赋给另一个jsp 页面的一个text 控件 上有打错 是button 不是 burron 在my.jsp 有一个button 上 onclick()事件上调用如下的代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 window.parent.opener.myform.result.value="滴吧贱B"myform 是父窗体的form名称 result是父窗体form中的一个元素 我以前写过几个页面间传值的小例子,找给比较简单的给你吧,把代码直接粘出来就ok了:---------------------------------这是父页面:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>AA</title></head><body><form name="form">向子页面传的值:<input type="text" name="aa" /><input type="button" value="submit" onclick="window.open('b.html','_blank','height=200,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');" /></form></body></html>---------------------------------这是弹出页面:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>BB</title><script language="javascript"><!--function fuzhi(){ var a = document.ad.str1.value; var b = document.ad.str2.value; var c = a + b; window.opener.form.aa.value = c; window.close();}// --></script></head><body><form name="ad"><table width="300" height="150" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#FF0000"> <tr> <td bgcolor=white>父窗口传来的值是: <!-- ----------------------------- --> <script language="javascript"> var aaa=window.opener.form.aa.value; document.write(aaa); </script> <!-- ----------------------------- --> </td> </tr> <tr> <td align="center" valign="middle" bgcolor="#FFFFFF"> <input type="button" value="给母窗口赋值" onclick="fuzhi()" /> </td> </tr> <td bgcolor=white> 回传的第一个字符串:<br><input type="text" name="str1" /><br>回传的第二个字符串:<br><input type="text" name="str2" /> </td></table></form></body></html> 在html中写js代码 js 变量未定义问题 请教一个JS代码 请看这个问题。。。 如何让img的src由JAVASCRIPT取得 showModalDialog打开的页面如何让它在最前显示? 有没有好用的生成表单验证代码的软件? 如何动态的添加html的表的行列!! 我想onmouseover时,BUTTON背景blue,前景white 关于js的问题 求框架刷新 讨论怎样隐藏链接地址不让客户端找到?
---------------------------------
这是父页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>AA</title>
</head>
<body>
<form name="form">
向子页面传的值:
<input type="text" name="aa" /><input type="button" value="submit" onclick="window.open('b.html','_blank','height=200,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');" />
</form>
</body>
</html>
---------------------------------
这是弹出页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>BB</title>
<script language="javascript"><!--
function fuzhi(){
var a = document.ad.str1.value;
var b = document.ad.str2.value; var c = a + b; window.opener.form.aa.value = c;
window.close();
}
// -->
</script>
</head><body>
<form name="ad">
<table width="300" height="150" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#FF0000">
<tr>
<td bgcolor=white>父窗口传来的值是:
<!-- ----------------------------- -->
<script language="javascript">
var aaa=window.opener.form.aa.value;
document.write(aaa);
</script>
<!-- ----------------------------- -->
</td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF">
<input type="button" value="给母窗口赋值" onclick="fuzhi()" />
</td>
</tr>
<td bgcolor=white>
回传的第一个字符串:<br><input type="text" name="str1" /><br>回传的第二个字符串:<br><input type="text" name="str2" />
</td>
</table>
</form>
</body>
</html>