[新手的请教]window.showModalDialog的子窗口input为checkbox或radio时返回undefined

computer01 2004-10-29 08:00:01
父页 a.jsp
<script language="JavaScript">
function select(str)
{
var selResult = window.showModalDialog("b.jsp","","center:1;status:0;help:0;resized:1;dialogheight:18;dialogwidth:18")
document.all.phone.value = selResult;
}
</script>

<input type=text name=phone value="" >
<input name="button" type="button" class = "input_button" onclick = "select(phone.value)" value = "选择...">

子页 b.jsp
<script language="JavaScript">
function okbutton_onclick() {
alert(theform.TRAINER_ID.value);
window.returnValue = document.theform.TRAINER_ID.value;
window.close();
}
</script>
<form name="theform" method="get" target="_self">
<%for(int i = 0;i < trainer.size();i++){
rowGroup = (RowModel)trainer.get(i);
%>
<tr align=center>
<td><input type="radio" name="TRAINER_ID" id="TRAINER_ID" value="<%=rowGroup.getColumnValue("trainer_id")%>"></td>
<td><%=rowGroup.getColumnValue("trainer_origin")%> </td>
<td><%=rowGroup.getColumnValue("trainer_name")%> </td>
<td><%=rowGroup.getColumnValue("corp_name")%> </td>
<td><%=rowGroup.getColumnValue("trainer_course")%> </td>
<td><%=rowGroup.getColumnValue("opinion")%> </td>
<td><%=rowGroup.getColumnValue("trainer_charge")%> </td>
</tr>
<%
}
%>
</form>
注:省略了某些jsp代码
请问高手:为什么我用input type=text时可以返回值,但checkbox和radio就不行呢?
...全文
43 点赞 收藏 2
写回复
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yesjoy 2005-08-12
<script language="JavaScript">
function select(str)
{
var selResult = window.showModalDialog("b.jsp","","center:1;status:0;help:0;resized:1;dialogheight:18;dialogwidth:18")
alert(selResult);//看看你返回的值都是什么?然后再去看你b.jsp页面中是否写的不对
document.all.phone.value = selResult;
}
</script>
回复
jianeng310 2004-11-08
UP
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告