添了宝宝后婆媳的矛盾:asp不刷新页面在文本框中写入数据的问题
来源:百度文库 编辑:高考问答 时间:2024/05/01 21:46:08
使用window.showModalDialog方法可以实现,如
a.htm的内容
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language=javascript>
function OnClick(){
S=window.showModalDialog("b.htm");
document.all.item("Test").value=S;
}
</script>
</head>
<body>
<input id=Test type=text value="">
<input type=button value="OK" onclick="OnClick()">
</body>
</html>
b.htm的内容:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language=javascript>
function OnClick(){
window.returnValue=document.all.item("InputText").value;
window.close();
}
</script>
</head>
<body>
<input id="InputText" type=text value="">
<input type=button value="OK" onclick="OnClick()">
</body>
</html>
打开a.htm点击按钮,在文本框中输入文字,点击确定,该文字会显示在a.htm的文本框中。