关于ASP中iframe的问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 08:50:36
我在A中包含了B,想在A中得到B中表单的数据,但结果出错

AA.HTM

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>如何获取iframe中表单的值</title>
</head>

<body>
<form name="form1" method="post" action="">
<p>如何获取iframe中表单的值:</p>
<p> 这里显示iframe调用页面的表单值:
<input type="text" name="xianshi">
</p>
<p>这里是iframe页面。<iframe scrolling="no" frameborder="0" src="bb.htm" height="34" width="200"></iframe></p>
</form>
</body>
</html>

BB.HTM

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>iframe页面</title>
</head>

bb.htm改成
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>iframe页面</title>
</head>
<script language="javascript">
function gaibian1(v)
{
parent.document.form1.xianshi.value=v;
}
</script>
<body>
<form name="form2" method="post" action="">
<input name="uaa" type="radio" value="1"onclick="javascript:gaibian1(this.value);">111<input name="uaa" type="radio" value="2" onclick="javascript:gaibian1(this.value);">222

</form>
</body>
</html>