[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 657
  • Last Modified:

Mask Edit box in asp.net

I have a text box and need the user to enter in a time.  Is there a way to make a text box only allow a certain formate.  I need the date to be entered with the : in it.  An example is 9:58.  How can I check it is a number and that they enter in :.

Thanks
0
running32
Asked:
running32
  • 2
  • 2
1 Solution
 
daniel_ballaCommented:
Hi running32,
you can check it with a RegularExpressionValidator, with an expression such as ^\d{2}\:\d{2}$

Cheers!
0
 
kaliyugkaarjunCommented:
0
 
daniel_ballaCommented:
just a quick correction, better use the expression  ^\d{1,2}\:\d{1,2}$  as this will allow single digits too.

Cheers
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now