FrameMain.jsp
<frameset rows="*" cols="30%,*" frameborder="yes" border="2" framespacing="1">
<frame name="tree" src="/vtigu/newInspectTreeShow.do?qid=<ww:property value='pointofqid'/>">
<frameset rows="80,*" cols="*" frameborder="no" border="2" framespacing="1">
<frame name="topFrame" src="/vtigu/InspectResult.jsp" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" >
<frame name="show" src="/vtigu/inspectOfNewshow.do?insId=<ww:property value='insId'/>">
</frameset>
</frameset>
<noframes>
</noframes>
InspectResult.jsp
<body>
<input type="text" size="55" name="inspectsR" id="inspectsR" value="<ww:property value='insNames'/>" readonly="readonly;"/>
<input type="text" name="inspectidsR" id="inspectidsR" value=""/>
<input type="button" name="saveNewInspectsR" id="saveNewInspectsR" value="保存" class="btn_03"/>
</body>
js
/**
* 複選框 添加 考察點
*/
$("[id^=inspectCheckBox_]").click(function(){
//$("#inspectidsR",parent.topFrame.document).val($("#inspectids").val()+$(this).val()+",");
var newinspect=$("#inspectidsR",parent.topFrame.document).val();
//alert($(this).val());
//alert($(this).attr("checkboxtext"));
if($(this).attr("checked") == true){
$("#inspectids").val($("#inspectids").val()+$(this).val()+",");
$("#inspects").val($("#inspects").val()+$(this).attr("checkboxtext")+",");
}else{
$("#inspectids").val($("#inspectids").val().replace($(this).val()+",",""));
$("#inspects").val($("#inspects").val().replace($(this).attr("checkboxtext")+",",""));
}
$("#inspectidsR",parent.topFrame.document).val($("#inspectids").val()+newinspect);
});
//關閉子窗口,傳值給父窗口
$("#saveNewInspects").click(function(){
/**
* 考察點最多三個
*/
if($("#inspects").val().split(",").length >4){
alert("最多隻能選擇三個考察點");
return false;
}
// 將知識點回寫給父窗口
//alert($("#choose_inspect_names",window.parent.parent.opener.document).val());
$("#choose_inspect_names",window.parent.parent.opener.document).val($("#inspects").val());
//alert($("#choose_inspect_names",window.parent.parent.opener.document).val());
$("#choose_inspect_ids",window.parent.parent.opener.document).val($("#inspectids").val());
// 關閉窗口
window.parent.parent.close();
return false;
});