Jump to content


usedcarsforsales

Member Since 24/07/2010
Offline Last Active 24/07/2010, 04:32
-----

Posts I've Made

In Topic: Ajax Da Pagina Principal Nao Funciona Em Pagina Carregada Em Div

24/07/2010, 04:34

Asp.Net Ajax Calendar Control Validation For Date


To make Validation for Ajax Calendar so that usec cannot install Greater than or Less than Todays; date

This exammple demonstates Date Must not greater than Today’s Date

<asp:TextBox CssClass=”stdtextboxwidth” ID=”txtDate” runat=”server” Width=”180px”></asp:TextBox>
<cc1:CalendarExtender ID=”CalendarExtender1″ runat=”server” TargetControlID=”txtDate”
PopupButtonID=”imgDate” OnClientDateSelectionChanged=”checkDate”>
</cc1:CalendarExtender>
<img alt=”Calendar” src=”images/Calendar.png” id=”imgDate” />

Put Following Code into Javascript
<script type=”text/javascript”>
function checkDate(sender,args)
{
var dt = new Date();
if(sender._selectedDate > dt)
{
sender
._textbox
.set_Value(dt.format(sender._format));
alert(“You cannot Select Date Greater than Today”);
}

}
</script>
Asp.Net Ajax Calendar Control Validation For Date

Posted by Nilesh Rathod on March 19, 2010

To make Validation for Ajax Calendar so that usec cannot install Greater than or Less than Todays; date

This exammple demonstates Date Must not greater than Today’s Date

<asp:TextBox CssClass=”stdtextboxwidth” ID=”txtDate” runat=”server” Width=”180px”></asp:TextBox>
<cc1:CalendarExtender ID=”CalendarExtender1″ runat=”server” TargetControlID=”txtDate”
PopupButtonID=”imgDate” OnClientDateSelectionChanged=”checkDate”>
</cc1:CalendarExtender>
<img alt=”Calendar” src=”images/Calendar.png” id=”imgDate” />

Put Following Code into Javascript
<script type=”text/javascript”>
function checkDate(sender,args)
{
var dt = new Date();
if(sender._selectedDate > dt)
{
sender
._textbox
.set_Value(dt.format(sender._format));
alert(“You cannot Select Date Greater than Today”);
}

}
</script>

IPB Skin By Virteq