question

AypnCNN-4494 avatar image
0 Votes"
AypnCNN-4494 asked LanHuang-MSFT answered

How do I validate email Domain Names, while entering email address in Textbox using Jquery/Vb.net in Asp.net

Hi,

I have a few permitted Domain Name List,

List of domain names:

@abc123.com
@in.fsind.com
@test123.in

While clients entering email addresses in the textbox, it should be validated and allowed email addresses with the above domain names are only

For ex.

  • Accepted email address

pandi@abc123.com
bull.boopathi@test123.in

How do I validate by using JQuery or VB Code Behind?

Thanks in advance.






dotnet-aspnet-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LanHuang-MSFT avatar image
0 Votes"
LanHuang-MSFT answered

Hi @AypnCNN-4494,
What's your project type? Assuming your project is webform.
You can create an array using $.each to loop through each element, and then match the input value. Only all items of the array not match the value,it will alert message.
The code:
130721-text.png

Best regards,
Lan Huang


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.


text.png (41.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.