How can I prevent guest users from entering '+' sign or '0' in front of country-code in the visitor phone number field during self registration?
Few SMS service providers are not looking for '+' sign or '0' or '00' in front of the international phone numbers to trigger the sms. Providing these values in front of country code during self-registration may fail to deliver the sms to recipient.
Using a simple regular expression, you can validate the entered phone number during the guest registration.
The below regular expression will help you to validate the phone number and allows to register only when the phone number is not staring with '+' or '0'.
It also performs the below validations.
To add the above regex in the visitor_phone number filed, please navigate to ClearPass Guest >> Configuration >> (Pages)Guest Self-Registration >> select the self-registration page and go to Edit >> Register Page >> Form >> select the filed visitor_phone and set the Validator to " ISRegexMatch" and enter the above regex in the Validator Argument filed as shown below.
Note: Edit the Validation Error as per your requirement.
Adding the given regex will validate the phone number and prevent the guest user from registering the phone number starts with '+' or '0'.
Please find below the sample outputs for your reference.
Result when phone number starts with '+' or '0'.
At Aruba, we believe that the most dynamic customer experiences happen at the Edge. Our mission is to deliver innovative solutions that harness data at the Edge to drive powerful business outcomes.
© Copyright 2021 Hewlett Packard Enterprise Development LPAll Rights Reserved.