function assign_value(vname, vid)
{
window.opener.document.getElementById('P2_VENDOR_NAME').value = vname;
window.opener.document.getElementById('P2_VENDOR_ID').value = vid;
window.opener.document.getElementById('P2_X').value = vid;
window.opener.document.getElementById('P2_VENDOR_NAME').focus();
window.opener.doSubmit('LOAD_HEADER');
window.close();
}
callinng popup from the parent page
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,location=0,statusbar=0,menubar=0,scrollbars=1');");
}
{
window.opener.document.getElementById('P2_VENDOR_NAME').value = vname;
window.opener.document.getElementById('P2_VENDOR_ID').value = vid;
window.opener.document.getElementById('P2_X').value = vid;
window.opener.document.getElementById('P2_VENDOR_NAME').focus();
window.opener.doSubmit('LOAD_HEADER');
window.close();
}
callinng popup from the parent page
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,location=0,statusbar=0,menubar=0,scrollbars=1');");
}
Just to add, $x an $v can also be used as "short-hand" methods. So in above example we can replace,
ReplyDeletewindow.opener.document.getElementById('P2_VENDOR_NAME').value = vname;
window.opener.document.getElementById('P2_VENDOR_ID').value = vid;
window.opener.document.getElementById('P2_X').value = vid;
WITH
window.opener.document.$x('P2_VENDOR_NAME').value = vname;
window.opener.document.$x('P2_VENDOR_ID').value = vid;
window.opener.document.$x('P2_X').value = vid;
Hey AI,
ReplyDeleteThats nice . I used $x but not in this senario.
Thanks for making it more easier .
Regards,
Nandini Thakur