This is a migrated thread and some comments may be shown as answers.

Use MaskedTextBox for Email

1 Answer 1936 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 2
Bob asked on 22 Mar 2016, 08:23 PM

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

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 24 Mar 2016, 09:45 AM
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
Tags
MaskedTextBox
Asked by
Bob
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Share this question
or