将值从子级传递给父级并在父级表单中设置值以保存子级详细信息
我有一个 Child javascript 弹出窗口 jsp,它生成动态值表。我希望将这些表值传递到父窗口 jsp,然后单击“提交要存储在数据库中的子详细信息”。
父级使用的表单需要处理来自子级的表内容列表并执行保存过程
问候 罗恩
I have a Child javascript popup window jsp which generates dynamic table of values. I want these table values to be passed to the Parent window jsp and from there on click of Submit the child details to be stored in DB.
The Form which is used by the parent needs to handle these list of table contents coming from Child and do the saving process
Regards
Ron
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 window.opener 对象与父级进行通信。直接与父元素交互
或调用父函数并传递要作为参数提交的数据
。您可以设置表单的值并在此函数中提交它。
如果数据是子窗口的各个字段值,那么您可以使用打开子窗口时使用的变量从父窗口获取子窗口的元素,如下所示
使用
childObj
现在获取子窗口的数据:childObj.document.getElementById()
Use window.opener object to communicate to the parent. Either directly interact with the parent elements
or call a parent function and pass the data to be submitted as arguement
You can set the values of your form and submit it in this function.
If the data is individual field values of the child window then you can use the variable used while opening of the child window to get the child window's elements from parent as follows
use
childObj
to get child window's data now aschildObj.document.getElementById()