Use MaskedTextBox for Email

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

    Posted 22 Mar 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.
    AND
    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?

    TIA,
    Bob Mathis

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 24 Mar 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.

    Regards,
    Georgi Krustev
    Telerik
    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top