04-11-2019 10:44 AM
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!
Solved! Go to Solution.
04-11-2019 11:33 AM
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!
04-11-2019 11:37 AM - edited 04-15-2019 02:46 AM
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>
04-11-2019 10:52 AM
04-11-2019 11:33 AM
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!
04-11-2019 11:37 AM - edited 04-15-2019 02:46 AM
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>
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide