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>
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>