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

ISE BYOD portal, email address verification script

laposilaszlo
Level 1
Level 1

Hi,

On the BYOD portal/Device information page I have changed the "Description" Label to "Email Address".

Users should enter their  Email address in this field and I need a script under Optional content 2 that will verify the text as being a valid email address.

 This script works well on the Guest Self Registration page but doesn't want to work on the BYOD page:

setTimeout(function(){
$.validator.addMethod("customemailvalidator", function(value, element) {
return /^[^@\s]+@example.com$/i.test(value);
}, 'Please enter a valid email address.');
jQuery("[name='guestUser.fieldValues.ui_person_visited']").rules("add",{customemailvalidator:true});
}, 50);

Looking at the BYOD portal i see the following:

laposilaszlo_0-1692864888963.png

But the script doesn't work. I am not a jQuery expert, i have changed the name to  device.description, but still nothing.

 

Can someone tell me what is wrong with it? What i need to change?

 

 

Thanks,

Laszlo

 

1 Accepted Solution

Accepted Solutions

marce1000
VIP
VIP

 

 - Try to change the selector to jQuery("[name='device.email_address']". The updated script will look like this:

setTimeout(function(){
$.validator.addMethod("customemailvalidator", function(value, element) {
return /^[^@\s]+@example.com$/i.test(value);
}, 'Please enter a valid email address.');
jQuery("[name='device.email_address']").rules("add",{customemailvalidator:true});
}, 50);

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

View solution in original post

1 Reply 1

marce1000
VIP
VIP

 

 - Try to change the selector to jQuery("[name='device.email_address']". The updated script will look like this:

setTimeout(function(){
$.validator.addMethod("customemailvalidator", function(value, element) {
return /^[^@\s]+@example.com$/i.test(value);
}, 'Please enter a valid email address.');
jQuery("[name='device.email_address']").rules("add",{customemailvalidator:true});
}, 50);

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '