I would really appreciate some help on this. I think I have most of it right but for some reason it's not quite right. I think the problem is that I don't have the code right where the popup window calls the function in the parent window. Here is my code so far:
JAVASCRIPT ON PARENT PAGE:
var NewEmailImg;
function ChangeImage(img) {
alert("from functions.asp, ChangeImage function start");
NewEmailImg=img;
alert("from functions.asp, NewEmailImg = " + NewEmailImg);
}
function Change() {
alert("from functions.asp, Change function start");
emailIcon.src=' alert("from functions.asp, Change function end");
}
IMAGE AND LINK CODE (rs(eCount) comes from a db query):
<a href="#" onClick="alert('from setEmailIcon.asp, onClick event start'); ChangeImage(this);
openPopWin('emailResponseUpgrade.asp?ID=<%=rs("cid")%>&uID=<%=rs("urpID")%>&pID=<%=pID%>&pg=<%=pqs%>',
575, 465, 'scrollbars', 20, 20); alert('from setEmailIcon.asp, onClick event end');">
<% If rs("eCount") <> 0 then %>
<img id="emailIcon" name="emailicon" border="0" src="images/emailIcon.jpg" width="26" height="30">
<% Else %>
<img id="emailIcon" name="emailicon" border="0" src="images/emailIcon2.jpg" width="32" height="30">
<% End if %>
</a>
JAVASCRIPT IN POPUP WINDOW:
function changeEmailIcon() {
alert("from eTxtBox.asp, changeEmailIcon function start");
parent.window.opener.document.Change();
alert("from eTxtBox.asp, changeEmailIcon function end");
}
CALLING CODE IN POPUP WINDOW:
<input type="button" value="Send Email Message" onClick="alert('from eTxtBox.asp, submit button click');
changeEmailIcon();">
I all the alerts popup on schedule until it gets to the action line, parent.window.opener.document.Change(). the alert just before that line works, but the action line doesn't make the image change and the alert right after that doesn't show.
There isn't an error thrown, and I've tried several other calls, like window.opener.Change(), parent.parent.window.opener.document.change(), but nothing seems to work. Can anyone tell what I'm missing?
Thanks,
Loyd Campbell
JAVASCRIPT ON PARENT PAGE:
var NewEmailImg;
function ChangeImage(img) {
alert("from functions.asp, ChangeImage function start");
NewEmailImg=img;
alert("from functions.asp, NewEmailImg = " + NewEmailImg);
}
function Change() {
alert("from functions.asp, Change function start");
emailIcon.src=' alert("from functions.asp, Change function end");
}
IMAGE AND LINK CODE (rs(eCount) comes from a db query):
<a href="#" onClick="alert('from setEmailIcon.asp, onClick event start'); ChangeImage(this);
openPopWin('emailResponseUpgrade.asp?ID=<%=rs("cid")%>&uID=<%=rs("urpID")%>&pID=<%=pID%>&pg=<%=pqs%>',
575, 465, 'scrollbars', 20, 20); alert('from setEmailIcon.asp, onClick event end');">
<% If rs("eCount") <> 0 then %>
<img id="emailIcon" name="emailicon" border="0" src="images/emailIcon.jpg" width="26" height="30">
<% Else %>
<img id="emailIcon" name="emailicon" border="0" src="images/emailIcon2.jpg" width="32" height="30">
<% End if %>
</a>
JAVASCRIPT IN POPUP WINDOW:
function changeEmailIcon() {
alert("from eTxtBox.asp, changeEmailIcon function start");
parent.window.opener.document.Change();
alert("from eTxtBox.asp, changeEmailIcon function end");
}
CALLING CODE IN POPUP WINDOW:
<input type="button" value="Send Email Message" onClick="alert('from eTxtBox.asp, submit button click');
changeEmailIcon();">
I all the alerts popup on schedule until it gets to the action line, parent.window.opener.document.Change(). the alert just before that line works, but the action line doesn't make the image change and the alert right after that doesn't show.
There isn't an error thrown, and I've tried several other calls, like window.opener.Change(), parent.parent.window.opener.document.change(), but nothing seems to work. Can anyone tell what I'm missing?
Thanks,
Loyd Campbell