求教传值问题 希望得到这么一个效果:从父窗口弹出一子窗口用来显示可供选择的信息,在选择了子窗口信息提交后关闭子窗口并将所选信息返回给父窗口显示出来。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 请问有AJAX推荐学习资料吗? ajax其實基本的js也能實現 product.php<a href='Javascript: SelectProduct(1);' class='blue'>function SelectProduct(SelectRow){ var sRowId=document.all.rowId.value; window.opener.document.getElementById("productID"+sRowId).value =window.document.getElementById("productID"+SelectRow).value; window.opener.document.getElementById("ItemCode"+sRowId).value =window.document.getElementById("TypeName"+SelectRow).value; window.opener.document.getElementById("ProductCode"+sRowId).value =window.document.getElementById("ProductCode"+SelectRow).value; window.opener.document.getElementById("Description"+sRowId).value =window.document.getElementById("BrandName"+SelectRow).value +" "+window.document.getElementById("TypeName"+SelectRow).value +" "+window.document.getElementById("ModelNo"+SelectRow).value +" "+window.document.getElementById("ProductCode"+SelectRow).value;; window.opener.document.getElementById("UnitPrice"+sRowId).value =window.document.getElementById("NewPrice"+SelectRow).value; //window.close(); window.location.href="productvendorlist.php?rowId="+sRowId+"&productID=" +window.document.getElementById("productID"+SelectRow).value;}productvendorlist.php<td valign='center' align='center'><A Href='Javascript: SelectVendor("11"); '>Select</td>function SelectVendor(SelectRow){ var sRowId=document.all.rowId.value; window.opener.document.getElementById("cost"+sRowId).value =window.document.getElementById("NewCost"+SelectRow).value; window.close();} 用两个页面做:fathe.php<?phpecho $_GET['tex'];?><script type="text/javascript"> window.open("son.html","name","height=300,width=400");</script>son.html<html><head><title>子窗口</title><script type="text/javascript">function f1_submit(){ window.close("name");}</script></head><body><form name="f1" action="test.php"> <input name="tex" type="text"> <input type="button" value="提 交" onClick="f1_submit()"></form></body></html> 不好意思前段时间有事。我用你的方法还是不行啊,form的方法用POST或get都不行。php.ini也改了register_globals = On 用JS parent不就好了?onclick="set();"function set(){ window.close(); parent.document.getElementById('fsdfads').value='';} 看六楼兄弟的回复window.opener.document.getElementById("productID"+sRowId).value | 父窗体的= window.document.getElementById("productID"+SelectRow).value; | 子窗体的作用就是将子窗体上的某一控件的值赋给父窗体上的某一控件这段代码是写在子窗体中的 onclick="set();" function set() { window.close(); parent.document.getElementById('fsdfads').value=''; }还是这个简单明了 //test2.html<div id='test' style='width:200px;height:200px;border:1px solid red;'></div><input type='button' onclick='window.open("test3.html");' value='open'>//test3.html<script language='javascript'> function save() { var tmp = document.getElementById("ttt"); window.opener.document.getElementById("test").innerHTML = tmp.value; window.close(); }</script><input type='text' id='ttt' value='' name='ttt'/><input type='button' onclick='save();' value='save'> 静态化和缓存 怎么用循环语句列出一个图片和4行列表 分3行2列排列 关于php的一个正则表达式的问题 smarty显示??急! mysql 查询遇到的问题 用preg_match把字符串里的9位数字提出来 一个图书管理系统的疑问 请教 匹配这段,正则应该怎么写 php连接oracle,tanames.ora文件要怎么配置呢,多谢多谢,急 php连接access数据库的问题,郁闷~~ 关于域名重定向的问题 哪位仁兄把下面这段php的功能用.net C#给实现,给就给分。
请问有AJAX推荐学习资料吗?
其實基本的js也能實現
<a href='Javascript: SelectProduct(1);' class='blue'>function SelectProduct(SelectRow)
{
var sRowId=document.all.rowId.value;
window.opener.document.getElementById("productID"+sRowId).value
=window.document.getElementById("productID"+SelectRow).value;
window.opener.document.getElementById("ItemCode"+sRowId).value
=window.document.getElementById("TypeName"+SelectRow).value;
window.opener.document.getElementById("ProductCode"+sRowId).value
=window.document.getElementById("ProductCode"+SelectRow).value;
window.opener.document.getElementById("Description"+sRowId).value
=window.document.getElementById("BrandName"+SelectRow).value
+" "+window.document.getElementById("TypeName"+SelectRow).value
+" "+window.document.getElementById("ModelNo"+SelectRow).value
+" "+window.document.getElementById("ProductCode"+SelectRow).value;;
window.opener.document.getElementById("UnitPrice"+sRowId).value
=window.document.getElementById("NewPrice"+SelectRow).value;
//window.close();
window.location.href="productvendorlist.php?rowId="+sRowId+"&productID="
+window.document.getElementById("productID"+SelectRow).value;
}
productvendorlist.php<td valign='center' align='center'><A Href='Javascript: SelectVendor("11"); '>Select</td>function SelectVendor(SelectRow)
{
var sRowId=document.all.rowId.value;
window.opener.document.getElementById("cost"+sRowId).value
=window.document.getElementById("NewCost"+SelectRow).value;
window.close();
}
fathe.php
<?php
echo $_GET['tex'];
?>
<script type="text/javascript"> window.open("son.html","name","height=300,width=400");
</script>son.html
<html>
<head>
<title>子窗口</title>
<script type="text/javascript">
function f1_submit(){ window.close("name");
}
</script>
</head><body>
<form name="f1" action="test.php">
<input name="tex" type="text">
<input type="button" value="提 交" onClick="f1_submit()">
</form>
</body>
</html>
我用你的方法还是不行啊,form的方法用POST或get都不行。
php.ini也改了register_globals = On
onclick="set();"
function set()
{
window.close();
parent.document.getElementById('fsdfads').value='';
}
window.opener.document.getElementById("productID"+sRowId).value
|
父窗体的
= window.document.getElementById("productID"+SelectRow).value;
|
子窗体的作用就是将子窗体上的某一控件的值赋给父窗体上的某一控件
这段代码是写在子窗体中的
function set()
{
window.close();
parent.document.getElementById('fsdfads').value='';
}
还是这个简单明了
<div id='test' style='width:200px;height:200px;border:1px solid red;'></div>
<input type='button' onclick='window.open("test3.html");' value='open'>
//test3.html
<script language='javascript'>
function save()
{
var tmp = document.getElementById("ttt");
window.opener.document.getElementById("test").innerHTML = tmp.value;
window.close();
}
</script>
<input type='text' id='ttt' value='' name='ttt'/>
<input type='button' onclick='save();' value='save'>