Input mask on a text box?

  • Thread starter Thread starter Russ
  • Start date Start date
R

Russ

Is it possible to create a input mask on a text box?

If a user enters a date like this 060103 I would like to see it
automatically converted to 06/01/03. In Access if you set a input mask to
99/99/00;0; when the cursor enters the cell you see __/__/__ . That is the
functionality I am trying to accomplish.

Can it be done?
 
Not out of the box with ASP.NET. You have to use client-
side script to achieve this functionality or use a third-
party control.

Tu-Thach
 
Russ said:
Is it possible to create a input mask on a text box?

If a user enters a date like this 060103 I would like to see it
automatically converted to 06/01/03. In Access if you set a input
mask to 99/99/00;0; when the cursor enters the cell you see __/__/__
. That is the functionality I am trying to accomplish.

Can it be done?

Set the Text property of the text box to "__/__/__"
Add a RegularExpressionValidator to the form to get
validation. Use the expression "\d{1,2}/(\d{1,2}/\d{4}|\d{2})"
The automatic conversion is not readily available, though.
You'll have to add your own code for that.
 
I did some looking around and found a great component from a company called
Assisted Solutions. It has everything I was looking for and more.

Here is the URL if anyone else needs something like this:

http://www.assistedsolutions.com

Click on Web Components and you will find it there.

Kudos to them for making this a free download!
 
Back
Top