<scriptlanguage="javascript">function datacheck() {var win= window.showModalDialog("test1.asp?x",self,"");
} </script> <formname="input1" METHOD="POST"> <inputtype="text" name="txt" value="xxxxx"> <inputtype="button" value="确认提交" onClick="datacheck();"> </form> test1.asp
<script>var win;
window.onload=function(){
win= window.dialogArguments;var f= document.forms[0];
f.txt.value= win.document.input1.txt.value;
}function subit(){var f= document.forms[0];
f.action="xxxx.xx";
f.target="hf";// 递交到隐藏的iframe f.submit();
} </script> <form> <input type="text" name="txt"> <inputtype="button" onclick="subit();" value="递交"> </form> <iframename="hf" style="display:none;"> </iframe>
标红色的是在弹出的子窗口中接收父窗口的参数 我现在不想用 type="text" 接收 能不能换成用<%=request("txt")%>这种格式直接显示 不用文本框
} </script> <formname="input1" METHOD="POST"> <inputtype="text" name="txt" value="xxxxx"> <inputtype="button" value="确认提交" onClick="datacheck();"> </form> test1.asp
<script>var win;
window.onload=function(){
win= window.dialogArguments;var f= document.forms[0];
f.txt.value= win.document.input1.txt.value;
}function subit(){var f= document.forms[0];
f.action="xxxx.xx";
f.target="hf";// 递交到隐藏的iframe f.submit();
} </script> <form> <input type="text" name="txt"> <inputtype="button" onclick="subit();" value="递交"> </form> <iframename="hf" style="display:none;"> </iframe>
标红色的是在弹出的子窗口中接收父窗口的参数 我现在不想用 type="text" 接收 能不能换成用<%=request("txt")%>这种格式直接显示 不用文本框
<%=request("txt")%>不同用js去赋值
<script language="javascript">
function datacheck() {
var win = window.showModalDialog("test1.asp?x",self,"");
}
</script>
<form name="input1" METHOD="POST">
<input type="text" name="txt" value="xxxxx">
<input type="button" value="确认提交" onClick="datacheck();">
</form> test1.asp
<script>
var win;
window.onload=function(){
win = window.dialogArguments;
var f = document.forms[0];
f.txt.value = win.document.input1.txt.value;
}
function subit(){
var f = document.forms[0];
f.action = "xxxx.xx";
f.target="hf"; // 递交到隐藏的iframe
f.submit();
}
</script>
<form>
<input type="text" name="txt"><input type="button" onclick="subit();" value="递交">
</form>
<iframe name="hf" style="display:none;"></iframe>
楼上的能否帮忙改改
附test1.asp如下:<!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=utf-8" />
<title>无标题文档</title>
</head><body>
<script>
var win;
window.onload=function(){
win = window.dialogArguments;
//var f = document.forms[0];
//f.txt.value = win.document.input1.txt.value;
//document.getElementById("txt").value="sss";
}
function getValue()
{
win = window.dialogArguments;
document.write(win.document.input1.txt.value);
}
function subit(){
var f = document.forms[0];
f.action = "xxxx.xx";
f.target="hf"; // 递交到隐藏的iframe
f.submit();
}
</script>
<form>
<!--<input type="text" name="txt"> --><script>getValue();</script><input type="button" onclick="subit();" value="递交">
</form>
<iframe name="hf" style="display:none;"> </iframe>
</body>
</html>
不行啊
楼上的高手请赐教
还有一个问题:
我在showModalDialog() 也就是test1.asp 中用了第三方的打印控件
<input type="button" id="btnPrint" value="打印预览(Alt+o)" accesskey="o" onClick="ReYoPrint.Preview()">
<input type="button" id="btnPrint" value="直接打印(Alt+p)" accesskey="P" onClick="ReYoPrint.Print(true)">
怎么一按打印预览 或者直接打印 就直接退出test1.asp 页面呢?
模态窗口不支持???要怎么解决呢?
我在showModalDialog() 也就是test1.asp 中用了第三方的打印控件
<input type="button" id="btnPrint" value="打印预览(Alt+o)" accesskey="o" onClick="ReYoPrint.Preview()">
<input type="button" id="btnPrint" value="直接打印(Alt+p)" accesskey="P" onClick="ReYoPrint.Print(true)">
怎么一按打印预览 或者直接打印 就直接退出test1.asp 页面呢?
模态窗口不支持???要怎么解决呢?