Use MaskedTextBox for Email

2 posts, 0 answers
  1. Bob
    Bob avatar
    29 posts
    Member since:
    Dec 2014

    Posted 22 Mar 2016 Link to this post

    Not sure that the MaskedTextBox is the right control to use for this, but here goes:

    I need to have an input for an email address that:

    A) Is a hyperlink to start an email with displayed email address as the "To:" address.
    B) Allow the user to edit the email address if they so desire.

    So, first, I need to have it appear as a link that can be edited,

    Second, I need to know what I would use for a mask (assuming that this is the right control for this)

    Can anyone point me in the right directions?

    Bob Mathis

  2. Georgi Krustev
    Georgi Krustev avatar
    3741 posts

    Posted 24 Mar 2016 Link to this post

    Hello Bob,

    The MaskedTextBox widget is designed to work with a mask that has a strict length. In other words, if the mask is 10 chars then the input value should contain 10 chars too.

    What I believe will be a better match in this case is to use a regular INPUT element with pattern attribute or even an input with type="email". Thus you will be able to define a complex regular expression. If you would like to show/hide the input then you can easily do that using JavaScript.

    Georgi Krustev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top