页面传值 a.htm和b.htm没有直接的关系,所以只能靠提交到asp页面才可以处理 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 子页面用如下代码:<script language="javascript">function aa(){ document.form1.inp.value=document.form1.year.value+document.form1.month.value; window.returnValue=document.form1.inp.value; window.close() //alert(window.returnValue);}</script>父页面用如下代码:function fPopUpCalendarDlg(){ retval = window.showModalDialog("aaa.cfm", "", "dialogWidth:197px; dialogHeight:10px; status:no; directories:yes;scrollbars:no;Resizable=no;"); var src= retval; document.form1.date.value = src; if( retval == null ){ document.form1.date.value =""; }}这样就行了。 页面a.htm<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title>function SelectMenus(dataMenuCode,dataMenuName)var wMenuSelectWindow = "";{ sUrl = "b.htm?MenuCodeObj=" + dataMenuCode ; if (wMenuSelectWindow != "") { wMenuSelectWindow.focus(); } else { wMenuSelectWindow = window.open(sUrl, '', 'height=500,width=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,left=400,top=50'); }}</head><body><form name="form1" method="post" action=""> <input type="text" name="textfield"> <a target="_blank" onClick="SelectMenus(textField)">打开</a></form></body></html>b.htm<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><%sMenuCode=Request("menuCodeOjb")%><JAVASCRIPT language="javascript"> function SetValue(parm1,parm2) { opener.document.all.<%sMenuCode%>.value = parm1; opener.document.all.<%sMenuCode%>.value = parm2; }</script></head><body><form name="form1" method="post" action=""> <input type="checkbox" name="checkbox1" value="1"> 1 <input type="checkbox" name="checkbox2" value="2"> 2 <input type="button" name="Submit" value="提交" onClick="SetValue(1,2)"></form></body></html> 通过一个Input来过渡一下就行了。 提交的时候通过一个Text类型的Input来保存一下值就行了。 div+css [菜鸟自学五]富文本编辑器 有点受不了了,发发牢骚,关于框架的使用 jquery新手求助 請教:為什麼我輸出的隨機數有重複~!高手指教~~ jquery如何获取当前触发事件的控件ID值 新手提问,请大家帮帮我! javascript中如何控制document的上下左右边界(margin)为零? 怎么屏蔽以下按键:Ctrl+N, F5, 我找不出来了,30分送 今天来了一看,多了两个斑主,这两位能自我介绍一下吗 这种语句有谁见过?什么意思? 关于java类型转换的,急,高分求~~~~~
<script language="javascript">
function aa(){
document.form1.inp.value=document.form1.year.value+document.form1.month.value;
window.returnValue=document.form1.inp.value;
window.close()
//alert(window.returnValue);
}
</script>父页面用如下代码:
function fPopUpCalendarDlg(){
retval = window.showModalDialog("aaa.cfm", "", "dialogWidth:197px; dialogHeight:10px; status:no; directories:yes;scrollbars:no;Resizable=no;");
var src= retval;
document.form1.date.value = src;
if( retval == null ){
document.form1.date.value ="";
}
}
这样就行了。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
function SelectMenus(dataMenuCode,dataMenuName)
var wMenuSelectWindow = "";
{
sUrl = "b.htm?MenuCodeObj=" + dataMenuCode ;
if (wMenuSelectWindow != "")
{
wMenuSelectWindow.focus();
}
else
{
wMenuSelectWindow = window.open(sUrl, '', 'height=500,width=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,left=400,top=50');
}
}
</head><body>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<a target="_blank" onClick="SelectMenus(textField)">打开</a>
</form>
</body>
</html>
b.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%sMenuCode=Request("menuCodeOjb")%>
<JAVASCRIPT language="javascript">
function SetValue(parm1,parm2)
{
opener.document.all.<%sMenuCode%>.value = parm1;
opener.document.all.<%sMenuCode%>.value = parm2;
}
</script>
</head><body>
<form name="form1" method="post" action="">
<input type="checkbox" name="checkbox1" value="1">
1
<input type="checkbox" name="checkbox2" value="2">
2
<input type="button" name="Submit" value="提交" onClick="SetValue(1,2)">
</form>
</body>
</html>