Javascript: getElementByID does not work on the pop up pages?
461036Apr 11 2006 — edited Jan 14 2008I have two pages that call the same pop up page to get values chosen by the users. Once the value is chosen, a passBack function is called. I tried to use the getElementID to decide which is the calling page. However, it didn't work at all. The code is given as follows:
< script language="JavaScript" >
function passBack(passVal1)
{
if opener.document.getElementById("P8_search")==NULL
{
opener.document.getElementById("P6_name").value = passVal1;
opener.document.getElementById("P6_name").focus();
close();
}
else
{
opener.document.getElementById("P8_name").value = passVal1;
opener.document.getElementById("P8_name").focus();
close();
}
}
</script>
Can somebody kindly enough tell me where is wrong? Thanks in advance.