I am working on the date picker control and I do have one problem that you expert might help me out. When I click the image I created for the date picker the calendar is open up and I select the date and it will populate my text box. So far I do not have any problem but when I wanted to move from one month to another I want the pop up window to stay open but in this case it will disappear. For example when I change the month from September to October it will change to October and the pop up window will disappear. Below is my code that I use for this and hopefully some one will give me a clue how I can fix this. Thanks
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<script runat="server">
Sub calEventDate_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
StartDateStr.Text = calEventDate.SelectedDate.ToString("d")
End Sub
</script>
<html xmlns=" >
<head runat="server">
<script type="text/javascript">
function displayCalendar()
{
var datePicker = document.getElementById('datePicker');
datePicker.style.display ='block'
}
</script>
<style type="text/css">
#datePicker
{
display:none;
position:absolute;
border:solid 2px black;
background-color:white;
}
</style>
<title>Calendar with JavaScript</title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox id="StartDateStr" Runat="server" Style="width:190px" />
<img src="images/Calendar.gif" onclick="displayCalendar()" alt="date picker" />
<div id="datePicker">
<asp:Calendar
id="calEventDate"
OnSelectionChanged="calEventDate_SelectionChanged"
Runat="server" />
</div>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<script runat="server">
Sub calEventDate_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
StartDateStr.Text = calEventDate.SelectedDate.ToString("d")
End Sub
</script>
<html xmlns=" >
<head runat="server">
<script type="text/javascript">
function displayCalendar()
{
var datePicker = document.getElementById('datePicker');
datePicker.style.display ='block'
}
</script>
<style type="text/css">
#datePicker
{
display:none;
position:absolute;
border:solid 2px black;
background-color:white;
}
</style>
<title>Calendar with JavaScript</title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox id="StartDateStr" Runat="server" Style="width:190px" />
<img src="images/Calendar.gif" onclick="displayCalendar()" alt="date picker" />
<div id="datePicker">
<asp:Calendar
id="calEventDate"
OnSelectionChanged="calEventDate_SelectionChanged"
Runat="server" />
</div>
</form>
</body>
</html>