tags:

views:

35

answers:

1

I have a textbox which is used to enter the date.Now when the user enters the date in the specified format I have to validate at client side itself,if user gives other than the current date.(current date is the "actual date" when the user makes the entry)

A: 
<form id="form1" runat="server">
    <div>
    <table id="table1" runat="server" border="0" cellpadding="1" cellspacing="2">
    <tr>
    <td>
    <asp:Label id="lblDate" Text="Date" AssociatedControlID="txtDate" runat="server"></asp:Label>
    </td>
    <td>
    <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
    <asp:CompareValidator id="cmprDate" Text="(Invalid Date)" ControlToValidate="txtDate" Type="Date" Operator="DataTypeCheck" runat="server"></asp:CompareValidator>
    </td>
    </tr>
    </table>

    </div>
    </form>

try above code. it validate date in client side.

giri-net