showModalDialog传radio框的值
通过window.showModalDialog(popFile, window, winFeatures);传值
要从父页面取得一组radio框中当前所选的值。
window.dialogArguments.Form1.radio1.checked.value这样取值好像不行
------解决方案--------------------要先循环判断哪个RADIO被选中了,然后再传值document.form1.radio1[i].value,判断用if (document.form1.radio1[i].checked),i为下标
------解决方案--------------------[parent]
<!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>
function show()
{
var array = new Array();
var r1=document.getElementById( "1 ");
var r2=document.getElementById( "2 ");
array[0]=r1.value;
array[1]=r2.value;
window.showModalDialog( "child.html ",array);
}
</script>
</HEAD>
<BODY onload= "show(); ">
<input name= "1 " type= "radio " id= "1 " >
<input name= "1 " type= "radio " id= "2 " >
</BODY>
</HTML>
[child]
<!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>
var a = window.dialogArguments;
function show()
{
alert(a[0]);
alert(a[1]);
}
</script>
</HEAD>
<BODY onload= "show(); ">
</BODY>
</HTML>