469,954 Members | 1,759 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

Input mask on a text box?

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?
Nov 18 '05 #1
4 7746
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
-----Original Message-----
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 itautomatically converted to 06/01/03. In Access if you set a input mask to99/99/00;0; when the cursor enters the cell you see __/__/__ . That is thefunctionality I am trying to accomplish.

Can it be done?
.

Nov 18 '05 #2
Jos
Russ wrote:
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.

--

Jos Branders
Nov 18 '05 #3
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!
Nov 18 '05 #4
My product, Peter's Date Package, includes a DateTextBox that specifically
reformats dates, including adding the slashes when omitted. (It has numerous
other features including a popup calendar.) Details are at
http://www.peterblum.com/datecontrols/home.aspx.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com

"Russ" <ru**@NOSPAMacordiamn.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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?

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by dude | last post: by
1 post views Thread by Miranda Evans | last post: by
6 posts views Thread by Regnab | last post: by
5 posts views Thread by Vincent van Beveren | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.