cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2113
Views
0
Helpful
1
Comments
sivsivar
Cisco Employee
Cisco Employee

 

sivsivar_0-1626703536406.png

 

ISE 2.7 FCS

 

To display default country code and Place holder customization please follow the below steps.

 

  1. Upload the attached js file in Custom Portal Files.
  2. Go to portal and add the below script in the Registration Form page.
  3. Save the portal.
<script src="customFiles/maskedinput.js" type="text/javascript"></script><script>
    setTimeout(function() {
        if($('.flag-container') != null){
            var phoneField = $("input[name='guestUser.fieldValues.ui_phone_number']");
            phoneField.parent().after(phoneField);
            $('.intl-tel-input.allow-dropdown').remove();
        }
        var inputText = $("input[name='guestUser.fieldValues.ui_phone_number']")[0];
        window.intlTelInput(inputText, {
            nationalMode: false, 
            preventInvalidDialCodes: true,
            autoHideDialCode: false,
            separateDialCode: true,
            preferredCountries: [ "kz" ]
        });
        $("input[name='guestUser.fieldValues.ui_phone_number']").attr("placeholder", "(999) 999 99 99");
        $('[name="guestUser.fieldValues.ui_phone_number"]').mask("(999) 999 99 99");
        $("input[name='guestUser.fieldValues.ui_phone_number']").rules("remove");
        $('form[name="selfRegForm"]').on('submit', function(){
            $('form[name="selfRegForm"]').validate();
            if($('form[name="selfRegForm"]').valid()){                                              
                var phoneNumber = $('[name="guestUser.fieldValues.ui_phone_number"]').val();
                var removedExtraChars = phoneNumber.replace("(","").replace(")","").replace(/ /g,"");
                var dialCode = $('.selected-dial-code').text();
                $('[name="guestUser.fieldValues.ui_phone_number"]').val(dialCode +removedExtraChars);
            }
        });
    }, 1600);
</script>
Comments
maraz
Level 1
Level 1

Hello, will this work in 3.2 code? If so, can you clarify step 2, where to put the script.

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: