how to make the user to select only mondays in the ultrawebdatechooser?
Hi gagani,
Thank you for posting in our forum.
You can achieve this handling the CalendarValueChanging client-side event:
function WebDateChooser1_CalendarValueChanging(oCalendar, oDate, oEvent){ if (oDate.getDay() != 1) { oEvent.cancel = true; }}
Please let me know if this helps.
can we able to alert the user with "not-allowed" when the cursoris on other days when he tries to select?
You should use ClientSideEvents-CalendarValueChanging="_calendarvaluechanging" – without the braces, and it should be working correctly. To grey out all dates, except Mondays, you could handle the CalendarRenderDay event:
function WebDateChooser1_CalendarRenderDay(oCalendar, oDay, oEvent){
if ($(oDay.element).index() != 0) {
oDay.element.style.color = "grey";
}
This will work if Monday is the first column of the Calendar. Just change the number if it is at different index.
Let me know if this helps.
Monday is the first column of the calendar. But the above calendarrenderday event did not grey out and everything is in black itself.
I am attaching a complete sample for your reference. Do not hesitate to ask if you have any questions regarding the matter.
<igsch:webdatechooser id="txt_DateFrom" runat="server" nulldatelabel="" style="z-index: 104; left: 395px; position: absolute; top: 128px"> <ClientSideEvents CalendarRenderDay="_greyoutexceptmonday" CalendarValueChanging="_valuechanging" /> <CALENDARLAYOUT TitleFormat="Month" PrevMonthImageUrl="ig_cal_blueP0.gif" NextMonthImageUrl="ig_cal_blueN0.gif" /> </igsch:webdatechooser>
The following are the functions:
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<script type="text/javascript" language="javascript" >
function _valuechanging(oCalendar, oDate, oEvent) { if (oDate.getDay() != 1) { oEvent.cancel = true; } }
function _greyoutexceptmonday(oCalendar, oDay, oEvent) { if ($(oDay.element).index() != 0) {
} } </script>
No effect has been seen. The color is remained black for all days.
Everything seems correct. Have you added reference to the jQuery library?
Hi,
I'm just checking if you need any further assistance with the matter.
Hi aparnarege,
You have to add the jQuery reference in the head section of your master page. Also, note that the version 6.1 is outdated and is no longer supported. I would suggest you to upgrade your product.
Feel free to contact me if you have any further questions.
please find attached the complete aspx file
To attach a file, go to the 'options' tab when writing a reply.
My aspx page is completely in
</asp:Content>
Within that, I have all the things needed. So In the script tag within the content, when I introduced
the jquery as per you mentioned, even the selections of mondays has stopped working and user is able to select any day. so I didn't add the url of jquery. For now, it is only working for the selection of mondays, but still remained with the same problem of unable to grey out other days except monday.
I don't know how to attach my aspx file to this reply to give you more idea.