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

Aypn CNN 446 Reputation points
2021-09-08T10:22:01.86+00:00

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.

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Lan Huang-MSFT 30,186 Reputation points Microsoft External Staff
    2021-09-09T08:54:24.7+00:00

    Hi @Aypn CNN ,
    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.