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
Use window.opener object to communicate to the parent. Either directly interact with the parent elements
window.opener.document.getElementById()
or call a parent function and pass the data to be submitted as arguement
window.opener.parent_func(dataToSubmit)
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
var childObj=window.open(options);
use childObj
to get child window's data now as childObj.document.getElementById()
精彩评论