老板要我做一个这样的功能:有两个页面 a 和 b,点a 页面里的一个按钮,弹出一个新窗口b页面,b页面里有很多记录,每个记录前有个checkbox框,要求,勾选b页面里的
记录,提交后b页面关闭,选中的记录显示在a页面里,a页面显示这些记录的同时还要在每个记录后面跟个红叉,可以将显示在a页面的记录不要的删除掉。好象很难啊
解决方案 »
- 请教表单验证问题
- 用jQuery熟悉的 来帮我看看 这个好实现吗?是关于select框的
- 请教JavaScript怎么改变asp:image的图片imageurl和可见属性
- 如何在加了鼠标事件后,取到最新的代码
- js如何控制一个层让其显示的时候有一个渐变,也就是由潜到明的显示,好像有时间过程慢慢的出现?
- js高手帮忙
- 在母版页的内容页中怎样使用javascript
- excel问题,高手请进.............
- 根据javascript权威指南实现的cookie存储api哪些地方可以优化
- 请教一个JAVASCRIPT变量问题!急!!
- 请问prototype.js如何设置multipart/form-data头
- [100分],求:按住鼠标左键滑过表格,表格的单元格或行响应什么事件?在线,对了立即给分.
楼主 查一下 Window.Opener方法 好像可以完成你想要的
有两个页面 a 和 b,点a 页面里的一个按钮,弹出一个新窗口b页面,b页面里有很多记录,
--到这里因该很简单吧
每个记录前有个checkbox框,要求,勾选b页面里的记录,提交后b页面关闭,
--这里,在关闭前要处理一下,取出勾选记录的id,用opener.func(id)调用a页面的函数func,函数里将id提交到服务器,刷新页面。
选中的记录显示在a页面里,a页面显示这些记录的同时还要在每个记录后面跟个红叉,可以将显示在a页面的记录不要的删除掉。
--有了id,显示这些行普通了
假设a页面有个按钮<input type="button" value=" 打开页面 " onclick="openPage();">
写你的js
function openPage()
{
var result = dlgParentMul("DialogParent.jsp");
if(result!=null && result!=""){
clearFilters();
var tmp=result.split("$");
}
function dlgParentMul(dialogurl,dWidth,dHeight){
if(dWidth==null) dWidth=800;
if(dHeight==null) dHeight=600;
var strReturn=window.showModalDialo(dialogurl,"","dialogHeight:"+dHeight+"px;dialogWidth:"+dWidth+"px;dialogTop: tx;dialogLeft: tx;center:yes;help:no;resizable:no;status:no");
return strReturn;
}
在DialogParent.jsp写一个iframe连到b页面。
假设b有个提交按钮,<input type="button" value=" 打开页面 " onclick="referPage();">
和两个checkbox,
<html:checkbox styleId="natural" property="search_natural" value="1" /> 正常
<html:checkbox styleId="affair" property="search_affair" value="1" /> 事假
b的js
function referPage()
{
var natural = document.getElementById("natural").value;
var affair = document.getElementById("affair").value;
self.parent.returnValue = natural + "$" + affair;
self.parent.close();
}
不知道我的可以搞定不!
假设a页面有个按钮<input type="button" value=" 打开页面 " onclick="openPage();">
写你的js
function openPage()
{
var result = dlgParentMul("DialogParent.jsp");
if(result!=null && result!=""){
var tmp=result.split("$");
if(tmp[0] == "natural"){
//做你要做的处理,红叉等
}
if(tmp[1] == "affair"){
//做你要做的处理,红叉等
}
}
}
function dlgParentMul(dialogurl,dWidth,dHeight){
if(dWidth==null) dWidth=800;
if(dHeight==null) dHeight=600;
var strReturn=window.showModalDialo(dialogurl,"","dialogHeight:"+dHeight+"px;dialogWidth:"+dWidth+"px;dialogTop: tx;dialogLeft: tx;center:yes;help:no;resizable:no;status:no");
return strReturn;
}
在DialogParent.jsp写一个iframe连到b页面。
假设b有个提交按钮,<input type="button" value=" 打开页面 " onclick="referPage();">
和两个checkbox,
<html:checkbox styleId="natural" property="search_natural" value="1" /> 正常
<html:checkbox styleId="affair" property="search_affair" value="1" /> 事假
b的js
function referPage()
{
var natural = document.getElementById("natural").value;
var affair = document.getElementById("affair").value;
self.parent.returnValue = natural + "$" + affair;
self.parent.close();
}