Introduction : We have seen requirements to restrict list of email address in sponsor_email field during guest self registration. This article will help to validate the field value using a simple Java Script.
Environment : Supported on all Amigopod/ClearPass Guest versions.
Configuration Steps :
Step 1: In the below script, replace the form name with actual guest self registration page/form name. You could obtain the form name by navigating to ClearPass Guest >> Configuration >> Guest Self-Registration >> Select the registration page >> click on Edit and locate the form name as shown below.<script type="text/JavaScript"><!--{literal}function RegisterSubmit(form_name) { var frm = document.forms[form_name]; var error = 'Please enter a valid Email'; //converting the sponsor_email filed value to lower case here... var temp1= frm.sponsor_email.value.toLowerCase(); //Validating the field value/email address here... if(temp1 == "xyz@arubanetworks.com" ) //Multiple email addressed can be added using "||". Eg: if(temp1 == "xyz@arubanetworks.com" || temp1 == "abc@arubanetworks.com" || temp1 == "bcd@arubanetworks.com" ) { alert(error); Nwa_EnableFormButtons(guest_register); return false } else{ return true; } }//--> {/literal}</script> The above script don't allow the value/email "xyz@arubanetworks" in the Sponsor Email field.Step 2: Copy and paste the script in the register page footer by navigating to Configuration >> Guest Self-Registration >> Select the registration page >> Edit >> Register Page >> Footer >> Footer HTML.Step 3: Add the function name "RegisterSubmit" to the submit field in the same form by navigating to Configuration >> Guest Self-Registration >> Select the registration page >> Edit >> Register Page >> Form >> select the "submit" field >> Edit >> Advanced Properties >> AJAX Submit: >> ente the text "RegisterSubmit".
Answer : After the completion of above customization, the sponsor email field won't accept the restricted email addresses during the registration.
© Copyright 2024 Hewlett Packard Enterprise Development LPAll Rights Reserved.