cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
482
Views
1
Helpful
1
Replies

Validate if "Person being visited" mail ends with certain domains

mgollob
Level 1
Level 1

Hello all,

 

In my ISE Guest solution, sponsors have to approve the guest to get into the guest network. That means, the guest can register by himself and the sponsor gets a mail, where he can click Approve or Deny. This all works. But I want to check if the entered mail ends with certain domains when entering the field "Person being visited).

 

In the community I found the following code and it works too

 

<script>

 

setTimeout(function(){

 

$.validator.addMethod("customemailvalidator", function(value, element) {

 

return /^(\w+\.?)+@example\.com$/.test( value );

 

}, 'Please enter a valid email.');

 

jQuery("[name='guestUser.fieldValues.ui_person_visited']").rules("add",{customemailvalidator:true});

 

}, 50);

 

</script>

 

However, I want multiple domains to be possible, so for example example.com and test.com. In my regex understanding, I then actually just need to write /^(\w+\.?)+@(example|test)\.com$/.test( value ); here. However, this does not work. Only example.com is considered as correct here.

 

Can someone help me here please?

 

1 Accepted Solution

Accepted Solutions

mgollob
Level 1
Level 1

Problem solved. You need to restart the ISE

View solution in original post

1 Reply 1

mgollob
Level 1
Level 1

Problem solved. You need to restart the ISE

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: