As a (sorta) follow on from the following question - CustomValidator time c#.net - I would like to know if it is possible to use the CompareValidator to validate a time in a ASP.NET textbox?
I have attempted the following
<asp:CompareValidator ID="CompareValidator2" Operator="DataTypeCheck"
ControlToValidate="txtTime" runat="server" ErrorMessage="* Valid time is required"
Type="Date" Display="Dynamic" ForeColor="Red"></asp:CompareValidator>
I assumed this would work since DateTime supports (obviously) both date and times but the validator continues to fail validation with valid inputs.
So, is it possible to validate time using the CompareValidator or is a RegularExpression or Custom Validator required?
This looks like a duplicate post as seen here.
The anser was from the post was.
"This appearently cannot be done.
For the record; I used a custom validator..."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With