Click here to Skip to main content
15,887,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a ajax calender extender control in my page. if i select any day from Monday to friday then calnder automatically point out Monday of that particular week.

Please any one help to achive this .

eg:

if selected day in calender is 10 October 2012 (Wednesday) then it needs to be changed as 08 October 2012(Monday)

Thanks
Mohan
Posted

1 solution

function checkDate(sender,args){
if (sender._selectedDate.getDay() != 1){
alert("You can only select Mondays!");
<b>//here you can alert user or make selectedday = 1 true </b>
sender._selectedDate = new Date(); //set back to current date
sender._textbox.set_Value(sender._selectedDate.format(sender._format))
}
}


<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown">
<cc1:calendarextender id="CalendarExtender1" runat="server" xmlns:cc1="#unknown">
OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900