Input mask on a text box?

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?
 
T

Tu-Thach

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
 
J

Jos

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.
 
R

Russ

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top