当前位置: 代码迷 >> JavaScript >> 帮忙看看!怎样把对话框里面的值或者一个网页的输入值传到另一个网页的text框中!多谢
  详细解决方案

帮忙看看!怎样把对话框里面的值或者一个网页的输入值传到另一个网页的text框中!多谢

热度:71   发布时间:2012-03-02 14:40:29.0
帮忙看看!怎样把对话框里面的值或者一个网页的输入值传到另一个网页的text框中!谢谢!
比如说!我在一个网页中点击   弹出一个网页或者对话框,在弹出的网页或者对话框中输入值能够传到,第一点击的网页中的text框中??谢谢   帮帮忙???

------解决方案--------------------
a.html
<!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 LANGUAGE= "JavaScript ">
<!--
function openNewDialog(){
var url = "b.html ";
var strReturn = window.showModalDialog(url);
document.getElementById( "text1 ").value = strReturn;
}
//-->
</SCRIPT>
</HEAD>

<BODY>
<INPUT TYPE= "text " NAME= "text1 ">
<INPUT TYPE= "button " onclick= "openNewDialog() " value= "test ">
</BODY>
</HTML>

b.html:
<!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= " ">

</HEAD>

<BODY onunload= "window.returnValue=document.getElementById( 'text1 ').value; ">
<INPUT TYPE= "text " NAME= "text1 " value= " ">

</BODY>
</HTML>

  相关解决方案