Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    RadDatePicker validation

    Hi

    Using RadDatePicker and calendar popup for my application, but having hard time validating it.
    To disable any input i used DateInput-Enabled=false.

    I have two fields
    Date Created and
    Date Completed

    The validation i want to do is
    Date Completed should not be less than Date Created.

    not able to set Minimum in DateCompleted to DateCreated
    The code is

    Code:
    <tr>
    <td><radCln:RadDatePicker ID="DateCreated" runat="server"  DateInput-CausesValidation=true DateInput-Enabled=false  DateInput-ForeColor="Black"></radCln:RadDatePicker>
    </tr>
               
    <tr>       
    <td><radCln:RadDatePicker ID="DateCompleted" runat="server" DateInput-CausesValidation=true  DateInput-Enabled=false DateInput-ForeColor="Black"></radCln:RadDatePicker>
    </tr>
    Thank you

  • #2
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can follow this example. That solved my problem

    Also here is the code:
    Code:
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <table>
                <tr>
                    <td>
                        <telerik:RadDatePicker ID="RadDatePicker1" MinDate="2009/1/1" runat="server" DateInput-Label="Start:">
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="RadDatePicker1"
                            ErrorMessage="Enter a date!"></asp:RequiredFieldValidator>
                    </td>
                    <td rowspan="2">
                        <asp:Label ID="Label1" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadDatePicker ID="RadDatePicker2" MinDate="2009/1/1" runat="server" DateInput-Label="End:">
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator runat="server" ID="Requiredfieldvalidator2" ControlToValidate="Raddatepicker2"
                            ErrorMessage="Enter a date!"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="Raddatepicker2"
                            ControlToCompare="RadDatePicker1" Operator="GreaterThan" Type="Date" ErrorMessage="The second date must be after the first one.<br /><br />">
                        </asp:CompareValidator>
                    </td>
                </tr>
            </table>
            <asp:Button runat="server" Text="Save" ID="Button1" OnClick="Button1_Click"></asp:Button>
        </telerik:RadAjaxPanel>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •