Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date picker

Status
Not open for further replies.

kebele

MIS
Jul 31, 2006
107
US
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>
 
hi,

this is happening because the visiblity of the DIV is controlled using JavaScript.

Make the DIV and image also server controls and control visibility in your server script...

Known is handfull, Unknown is worldfull
 
Thanks for the reply.Can you give me an example how this can be done. thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top