Image disappears when returning from popup

T

teddysnips

The HTML below shows an image button with an image "Calendar.gif".
You've probably guessed that, when pressed, it pops up a "date picker"
page (hence the need for the hidden inputs). When the button is
pressed, the "Calendar.gif" image is replaced by a "Calendar-
pressed.gif" image.

It all works fine, except that when the pop-up is closed, the image
button "loses" its image - in other words, it shows the missing image
picture and the text "Calendar".

Anyone any ideas why? This is an ASP page, if that makes any
difference.

Thanks

Edward

<html>
<body>
<p><input type="image" name="cmdStartCal" alt='"Calendar"' src="Images/
Calendar.gif" language="javascript" onclick="return
cmdStartCal_onclick()"></p>
<p><input type="hidden" id='txtHiddenField' name="txtHiddenField"
size="1">
<input type="hidden" id='txtHiddenControl' name="txtHiddenControl"
size="1">
<input type="text" id='txtStartDate' name="txtStartDate" size="20"></
p>
<script type="text/javascript">
<!--
function cmdStartCal_onclick()
{
if (document.all.item("txtHiddenField").value == "")
{
document.all.item("cmdStartCal").src = "images/Calendar-
pressed.gif";
document.all.item("txtHiddenField").value = "txtStartDate";
document.all.item("txtHiddenControl").value = "cmdStartCal";
window.open("jscript/Calendar.htm", "_blank", "top=" +
(screen.height-200)/2 + ",left=" + + (screen.width-200)/2 +
",height=250,width=250,status=no,toolbar=no,menubar=no,resizable=no,location=no,scrollbars=no");
}
}

-->
</script>
</body>
</html>
 
T

teddysnips

The HTML below shows an image button with an image "Calendar.gif".
You've probably guessed that, when pressed, it pops up a "date picker"
page (hence the need for the hidden inputs). When the button is
pressed, the "Calendar.gif" image is replaced by a "Calendar-
pressed.gif" image.
[...]
Found it - I was being incredibly dumb. It was in the onunload event
of the Calendar page.

Edward
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top