How to block Guest users from registering an account by specifying own email as sponsor email

MVP Expert
MVP Expert

Clearpass Guest Self Registration setup


By using the Ajax Submit feature in Clearpass Guest, we can validate user entered data for email, sponsor email field and show an alert to enter a valid sponsor email address.



Edit the self registration -> Register Page -> Forms -> Submit field.

Enabled the option to show advanced properties.

Enter the text 'RegisterSubmit' in AJAX Submit field and save changes.

Edit the self registration -> Register Page -> Footer HTML, enter the following script and save changes.


var fieldName1 ="sponsor_email";
var fieldName2 ="email";
function RegisterSubmit(form_name) {

var sponsor_email = document.forms[form_name][fieldName1].value;
var email = document.forms[form_name][fieldName2].value;
   if (sponsor_email == email ) {
   declareInvalid(form_name, 'Please enter a valid sponsor email');
   return false;
    return true; // Proceed to regular

function declareInvalid(form_name, ruleBroken) {
  alert("not a valid sponsor email: " + ruleBroken);
  var tidField = document.forms[form_name][fieldName1]; = "2px solid red";





Perform a test self registration by entering same email and sponsor email to test the alert:



Version history
Revision #:
2 of 2
Last update:
‎05-12-2016 07:22 PM
Updated by:
Labels (1)

Hi ,


I tried this code but same is not working.Have anyone tested this successfully...




Hi Sharafudheen


I just tested it and its working well. Make sure to follow the steps carefully.



Hi dmendez7,


Thanks for the clarification There was a mistake in the Field name used for valdation from my side.Post correcting the same the logic works fine.Thanks a lot.Very helpful article.

Also would like to clarify is there any coding that can be written by which we can trigger an email to user requesting WiFi access in case his request has been rejected by Sponsor.

Search Airheads
Showing results for 
Search instead for 
Did you mean: