cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1081
Views
10
Helpful
3
Replies

Guest Portal script to add number at the beginning of the phone

Eric Pineda
Cisco Employee
Cisco Employee

Hi Team,

 

Need a script to simply add a number (for example 1) to the beginning of the phone without replacing anything. ISE 2.3 or higher.

 

Thanks!

2 Accepted Solutions

Accepted Solutions

Hi Jason,

 

Thanks, my JS "skills" are very basic and I've struggled in the past with some more complex but this one seems straightforward. This is what I came up with based on the previous posts you linked:

 

<script>

$('[id="ui_self_reg_submit_button"]').on('click', function(evt){

    var phoneInput = $('#guestUser\\.fieldValues\\.ui_phone_number');

    var phoneNumber = phoneInput.val();

      phoneInput.val(1 + phoneNumber);

  });  

</script>

I think it probably has some redundant stuff or could be simplified, but I tested and its working fine!

View solution in original post


I think it probably has some redundant stuff or could be simplified, but I tested and its working fine! @Eric Pineda

The script provided in the community page is simple and straight forward as he said. If he still wants to simplify the code he can use the below one where I removed a line and not much changes required.

 

<script>

$('#ui_self_reg_submit_button').on('click', function(evt){

var phoneInput = $('#guestUser\\.fieldValues\\.ui_phone_number');

phoneInput.val(1 + phoneInput.val());

});

</script>


 

View solution in original post

3 Replies 3

Jason Kunst
Cisco Employee
Cisco Employee
http://cs.co/ise-guest

Look at the options under and play with some scripting to make it work for you?
https://community.cisco.com/t5/security-documents/ise-guest-amp-web-authentication/ta-p/3657224#toc-hId-1898236740

I will request one if you can’t ☺

Hi Jason,

 

Thanks, my JS "skills" are very basic and I've struggled in the past with some more complex but this one seems straightforward. This is what I came up with based on the previous posts you linked:

 

<script>

$('[id="ui_self_reg_submit_button"]').on('click', function(evt){

    var phoneInput = $('#guestUser\\.fieldValues\\.ui_phone_number');

    var phoneNumber = phoneInput.val();

      phoneInput.val(1 + phoneNumber);

  });  

</script>

I think it probably has some redundant stuff or could be simplified, but I tested and its working fine!


I think it probably has some redundant stuff or could be simplified, but I tested and its working fine! @Eric Pineda

The script provided in the community page is simple and straight forward as he said. If he still wants to simplify the code he can use the below one where I removed a line and not much changes required.

 

<script>

$('#ui_self_reg_submit_button').on('click', function(evt){

var phoneInput = $('#guestUser\\.fieldValues\\.ui_phone_number');

phoneInput.val(1 + phoneInput.val());

});

</script>