Input mask on a text box?

Discussion in 'ASP .Net' started by Russ, Dec 29, 2003.

  1. Russ

    Russ Guest

    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?
    Russ, Dec 29, 2003
    #1
    1. Advertising

  2. Russ

    Tu-Thach Guest

    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 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?
    >
    >
    >.
    >
    Tu-Thach, Dec 29, 2003
    #2
    1. Advertising

  3. Russ

    Jos Guest

    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
    Jos, Dec 29, 2003
    #3
  4. Russ

    Russ Guest

    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!
    Russ, Dec 29, 2003
    #4
  5. Russ

    Peter Blum Guest

    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:

    "Russ" <> wrote in message
    news:%...
    > 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?
    >
    >
    Peter Blum, Dec 30, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cjl
    Replies:
    1
    Views:
    10,487
    Michael Winter
    Oct 31, 2005
  2. =?Utf-8?B?RG9u?=

    Input Mask on Text box

    =?Utf-8?B?RG9u?=, May 9, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    3,953
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    May 9, 2007
  3. TBC

    Input mask for Text Box Control

    TBC, Sep 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    386
    Robert Koritnik
    Sep 13, 2004
  4. Marcin Tyman

    Conversion mask in hex to bit mask

    Marcin Tyman, May 6, 2008, in forum: Ruby
    Replies:
    4
    Views:
    776
    Robert Klemme
    May 6, 2008
  5. 187
    Replies:
    2
    Views:
    538
    Bart Lateur
    Jul 29, 2004
Loading...

Share This Page