I have an aspx that uses a button to prompt a calendar to pop up. The onclick event of the button causes the display property of the calendar to be set to "block" from "none" in javascript and when the OnSelectionChanged of the calendar is activated a textbox is loaded with the date in the code behind and the postback causes the display property on the calendar to be set back to "none". It sort of works but when the calendar pops up it appears to be "overlain" by the initial form...it is partially visible and the date selection works but where the initial form has content it overlays the calendar. Can someone tell me what I'm doing wrong? Thanks in advance for any help.
The textbox and button look like...
<asp:TextBox ID="subenergizationdate" CssClass="ShowCell" runat="server" AutoPostBack="true"></asp:TextBox><img alt="linkimage.gif" src="linkimage.gif" onclick="popupCalendar()" /><br />
...the javascript looks like...
<script type="text/javascript">
function popupCalendar() {
var dateField = document.getElementById('dateField');
// toggle the div
if (dateField.style.display == 'none') {
dateField.style.display = 'block';
}
else {
dateField.style.display = 'none';
}
}
</script>
...and the code behind looks like...
Sub calDate_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
subenergizationdate.Text = calDate.SelectedDate.ToString("d")
End Sub