请问,这样的功能怎么实现 在B页面好象没有 name=xz 的文本框吧, 且按钮用button就可以了不必用submit 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不好意思啊写错了我改正一下b页面的代码<SCRIPT language="JavaScript">function getValue(){ opener.write(document.all.yhmc.value);}</script><input type="text" name="yhmc"><nput type="button" name="Submit" value="按钮" onClick="getValue()">我随便在文本框输入点东西,可是这个结果在a页面得到的是undefined Post.htm<input type=text name=maintext><input type=button onclick="window.open('Read.htm')" value="Open">Read.htm<script language="javascript" >//window.open打开的窗口.//利用opener指向父窗口.var parentText = window.opener.document.all.maintext.value;alert(parentText);</script> a.htm<input type=button onclick="window.open('b.html')" value="Open"><input type="text" name="yhmc">b.htm<SCRIPT language="JavaScript">function getValue(){ var parentText = window.opener.document.all.yhmc.value; document.all.yhmc.value=parentText;}</script><input type="text" name="yhmc"><input type="button" name="Submit" value="按钮" onClick="getValue()"> 以前做的,希望能有用 ...-------main.asp----------<html> <head> <title>Login</title> <script language="javascript"> <!-- function Win_open(strif) { if (strif == '1') { window.open("Tel.asp",'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no'); } } //--> </script> </head> <body> <form name="form1"> <table> <tr> <td> <select name=class size="1" onchange="Win_open(this.value);"> <option value="0" selected>普通用户</option> <option value="1" >VIP用户</option> </select> </td> <td> 您的手机号:<input name="T1" size="30" disabled> </td> </tr> </table> </form> </body></html>----------------- Tel.asp ------------------<html> <head> <title>PhoneCode</title> <script language="javascript"> <!-- function Win_close() { if (document.form1.TT1.value == '') { alert(" 必須填入手机号!"); } else { window.opener.document.form1.elements['T1'].value = document.form1.TT1.value; window.close(); } } //--> </script> </head> <body> <form name="form1"> <table> <tr> <td> <input type="button" name="B1" value="提交" onclick="Win_close();"> </td> </tr> <tr> <td> 请输入您的手机号: </td> <td> <input type="text" name="TT1" size="20" maxlength="11"> </td> </tr> </table> </form> </body></html> jquery 一个显示二级导航栏问题 jq 如何实现加载数据 js中可以改变一个已定义好的样式嘛 在网页中实现音乐连播问题 关于cookie最近浏览商品,谢谢 asp 表单验证问题 有谁知道dojo 1.3.1版本和1.1.1版本的区别是什么 求简洁代码 到底要怎么求字符串的长度 如何通过检查注册表中某项的值来控制<object>标签是否运行 请问各位高手哪里有JAVASCRIPT 的教材 地区选择的下拉列框问题?
写错了
我改正一下
b页面的代码
<SCRIPT language="JavaScript">
function getValue()
{
opener.write(document.all.yhmc.value);
}
</script>
<input type="text" name="yhmc">
<nput type="button" name="Submit" value="按钮" onClick="getValue()">
我随便在文本框输入点东西,
可是这个结果在a页面得到的是undefined
<input type=button onclick="window.open('Read.htm')" value="Open">Read.htm<script language="javascript" >
//window.open打开的窗口.
//利用opener指向父窗口.
var parentText = window.opener.document.all.maintext.value;
alert(parentText);
</script>
<input type=button onclick="window.open('b.html')" value="Open">
<input type="text" name="yhmc">b.htm
<SCRIPT language="JavaScript">
function getValue()
{
var parentText = window.opener.document.all.yhmc.value;
document.all.yhmc.value=parentText;}
</script><input type="text" name="yhmc">
<input type="button" name="Submit" value="按钮" onClick="getValue()">
<head>
<title>Login</title>
<script language="javascript">
<!--
function Win_open(strif)
{
if (strif == '1')
{
window.open("Tel.asp",'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
}
}
//-->
</script>
</head>
<body>
<form name="form1">
<table>
<tr>
<td>
<select name=class size="1" onchange="Win_open(this.value);">
<option value="0" selected>普通用户</option>
<option value="1" >VIP用户</option>
</select>
</td>
<td>
您的手机号:<input name="T1" size="30" disabled>
</td>
</tr>
</table>
</form>
</body>
</html>
----------------- Tel.asp ------------------<html>
<head>
<title>PhoneCode</title>
<script language="javascript">
<!--
function Win_close()
{
if (document.form1.TT1.value == '')
{
alert(" 必須填入手机号!");
}
else
{
window.opener.document.form1.elements['T1'].value = document.form1.TT1.value;
window.close();
}
}
//-->
</script>
</head>
<body>
<form name="form1">
<table>
<tr>
<td>
<input type="button" name="B1" value="提交" onclick="Win_close();">
</td>
</tr>
<tr>
<td>
请输入您的手机号:
</td>
<td>
<input type="text" name="TT1" size="20" maxlength="11">
</td>
</tr>
</table>
</form>
</body>
</html>