怎么从一个选择窗口选值返回到父窗口的中?
a.jsp中:
<input name="aa" type="text" onDblclick="open()"/>
双击之后弹出b.jsp页面(选择的页面)
b.jsp:
<form name="fDictionary">
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th width="6%"> </th>
<th width="13%" align="center">序号</th>
<th width="66%" align="center">项目</th>
<th width="15%" align="center">是否共享</th>
</tr>
<tr>
<td width="6%">
<input type="radio" value="1" checked name="rselect">
</td>
<td width="13%" align="center">1</td>
<td width="66%" align="center">非技术问题</td>
<td width="15%" align="center">共享</td>
</tr>
<tr>
<td width="6%">
<input type="radio" value="2" name="rselect">
</td>
<td width="13%" align="center">2</td>
<td width="66%" align="center">技术问题 </td>
<td width="15%" align="center">共享</td>
</tr>
<input type="hidden" name="operation" value="">
</table>
</form>
我怎么在b页面中点某一条记录时就把“非技术问题、技术问题 ”这样的东西返回到a.jsp页面中的<input>框中?
这里的open()及b.jsp中的一些js函数该怎么写?
最好能有例子看看
<input name="aa" type="text" onDblclick="open()"/>
双击之后弹出b.jsp页面(选择的页面)
b.jsp:
<form name="fDictionary">
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th width="6%"> </th>
<th width="13%" align="center">序号</th>
<th width="66%" align="center">项目</th>
<th width="15%" align="center">是否共享</th>
</tr>
<tr>
<td width="6%">
<input type="radio" value="1" checked name="rselect">
</td>
<td width="13%" align="center">1</td>
<td width="66%" align="center">非技术问题</td>
<td width="15%" align="center">共享</td>
</tr>
<tr>
<td width="6%">
<input type="radio" value="2" name="rselect">
</td>
<td width="13%" align="center">2</td>
<td width="66%" align="center">技术问题 </td>
<td width="15%" align="center">共享</td>
</tr>
<input type="hidden" name="operation" value="">
</table>
</form>
我怎么在b页面中点某一条记录时就把“非技术问题、技术问题 ”这样的东西返回到a.jsp页面中的<input>框中?
这里的open()及b.jsp中的一些js函数该怎么写?
最好能有例子看看
...全文
请发表友善的回复…
发表回复
fason 2003-05-27
- 打赏
- 举报
function selectDictionary(inputname,inputvalue){
//var a1 = eval("window.opener."+inputname+);
var a1 = "window.opener."+inputname;
//eval("window.opener."+inputname+".value="+inputvalue)
eval(a1).value = inputvalue;
}
//var a1 = eval("window.opener."+inputname+);
var a1 = "window.opener."+inputname;
//eval("window.opener."+inputname+".value="+inputvalue)
eval(a1).value = inputvalue;
}
jianghua008 2003-05-27
- 打赏
- 举报
function selectDictionary(inputname,inputvalue){
//var a1 = eval("window.opener."+inputname);
var a1 = "window.opener."+inputname;
alert(a1); //显示 window.opener.formname.aa
a1.value = inputvalue;
alert(a1.value); //显示 undefined
}
值传不过来啊
如果我用eval的话,这个函数就没用了(错了?)
//var a1 = eval("window.opener."+inputname);
var a1 = "window.opener."+inputname;
alert(a1); //显示 window.opener.formname.aa
a1.value = inputvalue;
alert(a1.value); //显示 undefined
}
值传不过来啊
如果我用eval的话,这个函数就没用了(错了?)
zhangguagua 2003-05-23
- 打赏
- 举报
onclick="opener.document.all.aa.value='this.value'">
必须是window.open打开的才行哟。
必须是window.open打开的才行哟。
孟子E章 2003-05-23
- 打赏
- 举报
<input name="aa" type="text" onDblclick="window.open('b.jsp')"/>
in b.jsp:
<input type=button value=返回 onclick="opener.document.forms[0].aa.value='xxx'">
in b.jsp:
<input type=button value=返回 onclick="opener.document.forms[0].aa.value='xxx'">