This is a migrated thread and some comments may be shown as answers.

javascript validation for start-end datetime columns

1 Answer 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Minh
Top achievements
Rank 1
Minh asked on 20 Sep 2011, 10:59 PM
Hi,

I have a

1) start datetime column
2) End datetime column

I'm hoping to avoid having to rewrite everything and create a gridtemplate column for validation. I was wondering about anyway to perform javascript functions to warn the user that the End datetime column must always be greater than the start datetime column.


thanks,
Minh Bui

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Sep 2011, 05:42 AM
Hello Minh,

The easiest way is to use compare validation which gives the same required functionality.
aspx:
<EditItemTemplate>
   <telerik:RadDateTimePicker ID="radstarttime" runat="server" Width="225px">
   </telerik:RadTimePicker>
   <telerik:RadDateTimePicker ID="radendtime" runat="server" Width="225px">
   </telerik:RadTimePicker>
   <asp:CompareValidator ID="crvEndTime" runat="server" ControlToCompare="radstarttime" ControlToValidate="radendtime" Operator="GreaterThanEqual" ErrorMessage="End Time Must be Greater than Start Time" >
   </asp:CompareValidator>
</EditItemTemplate>
 
Thanks,
Shinu.
Tags
Grid
Asked by
Minh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or