首先b.htm中你要添加一个SUBMIT按钮 使网页提交一次 否则好像不太好做到
然后利用Response.redirct(a.htm/?text=radiotext)把B页面中你的单选按钮的值传递过去,同时把A.HTM网页重新刷新了一次, 在A.HTM中一开始用
if Request("text")="" then //来判断是否选择过单选按钮...
else
text.text=request("text")
end if
不知道有没有看懂我的意思
然后利用Response.redirct(a.htm/?text=radiotext)把B页面中你的单选按钮的值传递过去,同时把A.HTM网页重新刷新了一次, 在A.HTM中一开始用
if Request("text")="" then //来判断是否选择过单选按钮...
else
text.text=request("text")
end if
不知道有没有看懂我的意思
father.htm
<SCRIPT>function fnOpen(){window.showModalDialog("child.htm", window,
"")
}
</SCRIPT>
<FORM NAME=oForm>
<INPUT TYPE="text" NAME="txt1" id ="txt1">
<INPUT TYPE="button" VALUE="Push To Create"
onclick="fnOpen()">
</FORM>
------------------child.htm
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 2</title>
</head>
<body>
<form id =form1 name = form1 method =post>
<INPUT TYPE="radio" NAME="rbtn1" id ="rbtn1" value= "1" onclick ="doChange();" > aaa</input>
<INPUT TYPE="radio" NAME="rbtn1" id ="rbtn2" value= "2" onclick ="doChange();" > bbb</input>
<input type = button value = ok onclick = "window.close()">
</form>
</body>
<SCRIPT LANGUAGE="JavaScript">
<!--
var win = dialogArguments;
function doChange()
{
var strValue =""; for(var i=0;i<form1.elements.length;i++)
{ if (form1.elements[i].type == "radio")
{
if(form1.elements[i].checked)
{
strValue = form1.elements[i].value;
break;
}
}
}
win.document.getElementById("txt1").value= strValue;
}
//-->
</SCRIPT>
</html>
谢谢啊~~~~~
其实最简单的就是用window.open方法打开一个窗口,然后用新窗口的window.opener引用原窗口。如下:
文件:A.htm
<form name="form1" method="post" action="">
此处显示结果:<input name="text1" type="text" id="text1">
<input name="sel" type="button" id="sel" value="选择" onclick="window.open('b.htm','_blank')">
</form>
文件:B.htm
选择
<form name="form1" method="post" action="">
<input type="radio" name="seled" value="选择了A" onClick="window.opener.form1.text1.value=this.value;">
选择了A
<input type="radio" name="seled" value="选择了B" onClick="window.opener.form1.text1.value=this.value;">
选择了B
<input type="radio" name="seled" value="选择了C" onClick="window.opener.form1.text1.value=this.value;">
选择了C
</form>