Solved

Mask Edit box in asp.net

Posted on 2006-07-10
4
645 Views
Last Modified: 2006-11-18
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
Comment
Question by:running32
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
daniel_balla earned 500 total points
ID: 17076061
Hi running32,
you can check it with a RegularExpressionValidator, with an expression such as ^\d{2}\:\d{2}$

Cheers!
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
ID: 17081375
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
ID: 17081387
0
 
LVL 9

Expert Comment

by:daniel_balla
ID: 17082334
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.net dynamic formulas in runtime 11 75
Gridview alignment 1 20
Creating a route in asp.net webforms 2 28
ck editor is taking too much time to be loaded in asp 1 18
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question