Popup Calendar Issue

I

IntraRELY

When I click the next or previous month in the Calendar control the Calendar
disapprears. I assume this is due to the post back. This is the expected and
needed behavior when you click a day. However, when you are changing
months, you are not selecting a date, so you have to click the Calendar
Popup link again and it will be on the previous/next, which ever you
clicked, month so you can select the date you require.

I need a way to sort through the months, w/o it closing. Any ideas?

Thanks,

Steve

------------------------------------------------------------------------
----------------------------Problem Prototype-------------------------
------------------------------------------------------------------------

<%@ Page Language="VB" %>
<script runat="server">
</script>
<head runat="server">
<script type="text/javascript">
function displayCalendarBegin(cal)
{
var datePicker = document.getElementById(cal);
datePicker.style.display = 'block';
}
</script>
<style type="text/css">
.calStyle
{
display:none;
position:absolute;
border:solid 2px black;
background-color:White;
}
</style>
<title>Calendar Test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Time Entry</h3>
<div class =calStyle ID=calBegin>
<asp:Calendar ID="calStartDateTimeBegin" runat="server"
ToolTip="Select begin date to view hours." />
</div>
<img src="App_Themes/DefaultTheme/Images/CalendarLink.jpg"
onclick="displayCalendarBegin('calBegin')" />
</div>
</form>
</body>
</html>
 
M

marss

IntraRELY said:
When I click the next or previous month in the Calendar control the Calendar
disapprears. I assume this is due to the post back. This is the expected and
needed behavior when you click a day. However, when you are changing
months, you are not selecting a date, so you have to click the Calendar
Popup link again and it will be on the previous/next, which ever you
clicked, month so you can select the date you require.

I need a way to sort through the months, w/o it closing. Any ideas?

Thanks,

Steve

------------------------------------------------------------------------
----------------------------Problem Prototype-------------------------
------------------------------------------------------------------------

<%@ Page Language="VB" %>
<script runat="server">
</script>
<head runat="server">
<script type="text/javascript">
function displayCalendarBegin(cal)
{
var datePicker = document.getElementById(cal);
datePicker.style.display = 'block';
}
</script>
<style type="text/css">
.calStyle
{
display:none;
position:absolute;
border:solid 2px black;
background-color:White;
}
</style>
<title>Calendar Test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Time Entry</h3>
<div class =calStyle ID=calBegin>
<asp:Calendar ID="calStartDateTimeBegin" runat="server"
ToolTip="Select begin date to view hours." />
</div>
<img src="App_Themes/DefaultTheme/Images/CalendarLink.jpg"
onclick="displayCalendarBegin('calBegin')" />
</div>
</form>
</body>
</html>

The most of the changes that is made by the means of client-side
JavaScript do not post to the server.
You should pass the changes to the server manually and correct the
state of your Popup Calendar. For example:

Html:

.....
function displayCalendarBegin(cal)
{
var datePicker = document.getElementById(cal);
datePicker.style.display = 'block';
//save the changes to hidden field
document.getElementById('hidCalendarVisibility').value = 'block';
}
.....
<div class =calStyle ID=calBegin runat=server> //add runat="server"
attribute
.......
//add hidden field to store the changes
<input type=hidden id="hidCalendarVisibility" runat=server />
.....

Code: (C#, but I think you will understand)
protected void Page_Load(object sender, EventArgs e)
{
calBegin.Style["display"] = hidCalendarVisibility.Value;
}
Maybe it helps.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top