-2

I have two text boxs for time input. I'm trying to compare two time with format : 10:14:23 AM. Then End-TIme must be greater or equal to Start-Time. The ASP.NET CompareValidator doesnt offer the time type, so I'm thinking of using the Customvalidator. I never use Customvalidator to compare the two text boxs for time input before. How to compare the two time? Thank you.

Loso
  • 7
  • 1
  • 2

2 Answers2

1

Have you looked at the MSDN entry for the CustomValidator? It specifies usage and gives an example of how to use it:

Quick Joe Smith
  • 8,074
  • 3
  • 29
  • 33
1
                            <asp:CompareValidator 
                                ID="ClosedTime_CompareValidator" 
                                runat="server" 
                                ControlToCompare="OpenedTimeTextBox" 
                                ControlToValidate="ClosedTimeTextBox" 
                                ValidationGroup="Submit" 
                                Operator="GreaterThanEqual"
                                Display="Dynamic">
                                <img 
                                    src="./FormImages/warning.gif" 
                                    alt="The entry is not recognizabledate."/>

Bhargavi K
  • 11
  • 1
  • 2
    Welcome to SO. Please see [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer) – akshat May 16 '18 at 14:40