<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript) in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865823#M541482</link>
    <description>Thanks for the review. For the development of the Portal I need to open bidding for contracting services, it takes about 3 months.&lt;BR /&gt;Could you tell me how I have to find the ui_ of the custom fields in CISCO ISE? I'll try to validate with regex.&lt;BR /&gt;"guestUser.fieldValues.optionalData 1"&lt;BR /&gt;or&lt;BR /&gt;"guestUser.fieldValues.ui_CPF"&lt;BR /&gt;&lt;BR /&gt;Tks</description>
    <pubDate>Fri, 31 May 2019 15:18:03 GMT</pubDate>
    <dc:creator>mpissinati</dc:creator>
    <dc:date>2019-05-31T15:18:03Z</dc:date>
    <item>
      <title>CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858652#M541472</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Please, could anyone help me?&lt;/P&gt;&lt;P&gt;I am creating a Guest Portal and according to Law we need to store the data of the user (Name, Phone, Email and CPF).&lt;BR /&gt;CPF (represents the ID of the Brazilian identity document) in format "999.999.999-99". I've created a new custom field for this.&lt;/P&gt;&lt;P&gt;However, to verify that the identity document is valid or invalid there is a javascript algorithm for validation.&lt;/P&gt;&lt;P&gt;I need help to do the validation of this custom field called CPF with some javascript. I do not know how to make the javascript call on CISCO ISE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Links with the Javascript of validation of the CPF.&lt;BR /&gt;Script validation CPF &lt;A href="https://www.geradorcpf.com/javascript-validate-cpf.htm" target="_blank" rel="noopener"&gt;https://www.geradorcpf.com/javascript-validar-cpf.htm&lt;/A&gt;&lt;BR /&gt;Test validation CPF &lt;A href="https://www.geradorcpf.com/validar-cpf.htm" target="_blank" rel="noopener"&gt;https://www.geradorcpf.com/validar-cpf.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Mask JQuery &lt;A href="https://www.geradorcpf.com/mascara-cpf-com-jquery.htm" target="_blank"&gt;https://www.geradorcpf.com/mascara-cpf-com-jquery.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the internet there are other sites with the CPF validation algorithm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;Mauricio Pissinati&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS - I had made another Post, but when editing something went wrong and so I created this new post.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 22:56:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858652#M541472</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-17T22:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858658#M541473</link>
      <description>I will look into it, thanks for clearing it up. Is there perhaps a mock-up image you can use to edit and insert in same post?&lt;BR /&gt;</description>
      <pubDate>Fri, 17 May 2019 23:31:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858658#M541473</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-17T23:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858689#M541474</link>
      <description>&lt;P&gt;Hi Jason,&lt;BR /&gt;I'm adding a YouTube video where the analyst explains the valid CPF algorithm. The audio is in Portuguese but visually it is possible to understand the validation code.&lt;BR /&gt;The first check digit is the sum of the first 9 numbers. The second check digit is the sum of the 10 numbers.&lt;BR /&gt;Having the mask is also necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YouTube&amp;nbsp; = &lt;A href="https://youtu.be/aSUeH3Y31IQ" target="_blank"&gt;https://youtu.be/aSUeH3Y31IQ&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached an image&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On this site you can generate a valid CPF to use during the tests.&lt;BR /&gt;&lt;A href="https://www.geradorcpf.com/" target="_blank"&gt;https://www.geradorcpf.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this link has the rule for the validation of the CPF:&lt;BR /&gt;&lt;A href="https://www.geradorcpf.com/algoritmo_do_cpf.htm" target="_blank"&gt;https://www.geradorcpf.com/algoritmo_do_cpf.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;At the end of this page there are links to the javascript code already ready to implement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;BR /&gt;CPF "458.139.718-90" is valid.&lt;BR /&gt;If you change any number the CPF "458.139.718-91" for example is not valid.&lt;/P&gt;&lt;P&gt;Every person in Brazil has their own CPF. It is your personal identification code (similar to the passport number), we can use this information to audit who was the user who used the Guest Portal to surf the internet and track who misused the resource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I have been able to explain my need better.&lt;BR /&gt;Thank you very much&lt;BR /&gt;Mauricio&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 03:48:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858689#M541474</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-18T03:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858724#M541475</link>
      <description>Ok how do you expect to validate that the code is indeed their code? Having the portal reach out direct to another site may not be allowed. Are you simply validating format and physically validate an ID card to match later?&lt;BR /&gt;</description>
      <pubDate>Sat, 18 May 2019 07:32:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3858724#M541475</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-18T07:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3859080#M541476</link>
      <description>&lt;P&gt;Only validation if the CPF ID is valid is enough. We'll avoid too many junk registrations.&lt;BR /&gt;We will not cross the GUEST Portal with the base of the government.&lt;BR /&gt;You will make the Term of Acceptance where the user is responsible for informing the true data (if one day we need to respond to the audit or legal actions, we will cross manually with another data source to know if the CPF ID actually belongs to that user).&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 02:44:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3859080#M541476</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-20T02:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3859598#M541477</link>
      <description>&lt;P&gt;ok thanks will ask to see if we can help with this&lt;/P&gt;
&lt;P&gt;still working with development - 5/28/19&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:12:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3859598#M541477</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-28T15:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3864544#M541478</link>
      <description>PLease send me your email address to work further</description>
      <pubDate>Wed, 29 May 2019 14:44:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3864544#M541478</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-29T14:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3864599#M541479</link>
      <description>Hi Jason,&lt;BR /&gt;Could you tell me how to find the "ui_" of the custom fields in CISCO ISE?&lt;BR /&gt;"guestUser.fieldValues.optionalData 1"&lt;BR /&gt;or&lt;BR /&gt;"guestUser.fieldValues.ui_CPF"&lt;BR /&gt;&lt;BR /&gt;I find documents only for default fields&lt;BR /&gt;"guestUser.fieldValues.ui_phone_number"&lt;BR /&gt;&lt;BR /&gt;Since I need to put the Portal in Operation, I will try to create a regex initially.&lt;BR /&gt;&lt;BR /&gt;&amp;amp;lt;script&amp;amp;gt;&lt;BR /&gt;setTimeout(function(){&lt;BR /&gt;$.validator.addMethod("validaCPF", function(value, element) {&lt;BR /&gt;return /([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})/.test( value );&lt;BR /&gt;}, 'Please cpf OK.');&lt;BR /&gt;jQuery("[name='guestUser.fieldValues.optionalData 1']").rules("add",{validaCPF:true});&lt;BR /&gt;}, 50);&lt;BR /&gt;&amp;amp;lt;/script&amp;amp;gt;&lt;BR /&gt;&lt;BR /&gt;Tks</description>
      <pubDate>Wed, 29 May 2019 16:16:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3864599#M541479</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-29T16:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3864607#M541480</link>
      <description>mpissinati@timbrasil.com.br</description>
      <pubDate>Wed, 29 May 2019 16:35:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3864607#M541480</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-29T16:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865227#M541481</link>
      <description>Right now this is looking to be a little more work then normal scripting requests and doubtful we can deliver without an engagement with a vendor that does advanced customization. If you would like to engage a vendor very familiar with ISE then please reach out to me directly with your mailing address</description>
      <pubDate>Thu, 30 May 2019 15:35:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865227#M541481</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-05-30T15:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865823#M541482</link>
      <description>Thanks for the review. For the development of the Portal I need to open bidding for contracting services, it takes about 3 months.&lt;BR /&gt;Could you tell me how I have to find the ui_ of the custom fields in CISCO ISE? I'll try to validate with regex.&lt;BR /&gt;"guestUser.fieldValues.optionalData 1"&lt;BR /&gt;or&lt;BR /&gt;"guestUser.fieldValues.ui_CPF"&lt;BR /&gt;&lt;BR /&gt;Tks</description>
      <pubDate>Fri, 31 May 2019 15:18:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865823#M541482</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-31T15:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865932#M541483</link>
      <description>&lt;P&gt;Hi Jason,&lt;BR /&gt;I've enabled Inspect in Chrome browser and I've been able to identify the field.&lt;/P&gt;&lt;P&gt;&amp;lt;input type="text" name="guestUser.fieldValues.ui_cpf_text" data-validation-type="TEXT" maxlength="256" id="guestUser.fieldValues.ui_cpf_text" ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Made this validation script using regex. This script does not calculate if the CPF is true or false, but it will already help a lot, while I await the process of purchasing specialized services for the Portal.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;setTimeout(function(){&lt;BR /&gt;$.validator.addMethod("validaCPF", function(value, element) {&lt;BR /&gt;return /^(([0-9]{3}[.]?[0-9]{3}[.]?[0-9]{3}[-]?[0-9]{2})|([0-9]{11}))$/.test( value );&lt;BR /&gt;}, 'Please provide your real CPF number.');&lt;BR /&gt;&lt;BR /&gt;jQuery("[name='guestUser.fieldValues.ui_cpf_text']").rules("add",{validaCPF:true});&lt;BR /&gt;}, 50);&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;it's working fine&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 19:23:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3865932#M541483</guid>
      <dc:creator>mpissinati</dc:creator>
      <dc:date>2019-05-31T19:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3866905#M541484</link>
      <description>From our developers - Yes, that script is working fine but it is accepting invalid CPF IDs as well. I would recommend reaching out to me at jakunst@cisco.com</description>
      <pubDate>Mon, 03 Jun 2019 16:28:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/3866905#M541484</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2019-06-03T16:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/4006303#M541485</link>
      <description>&lt;P&gt;Hi guys, I have the same problem, any solution?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2020 00:33:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/4006303#M541485</guid>
      <dc:creator>paataides</dc:creator>
      <dc:date>2020-01-04T00:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/4006323#M541486</link>
      <description>&lt;P&gt;This was answered&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2020 03:38:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/4006323#M541486</guid>
      <dc:creator>Jason Kunst</dc:creator>
      <dc:date>2020-01-04T03:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/4136166#M562340</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same problem here, the script works but only garantee that people type numbers, but how I can prove that people its type the correct information?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I must garantee that UserX have CPF valid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any news about it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 21:39:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/4136166#M562340</guid>
      <dc:creator>josimaru85</dc:creator>
      <dc:date>2020-08-14T21:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascri</title>
      <link>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/5282749#M596008</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Version working on&amp;nbsp; 3.2 p7:&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;setTimeout(function() {&lt;BR /&gt;// Add CPF validation method using jQuery validator&lt;BR /&gt;$.validator.addMethod("validaCPF", function(value, element) {&lt;BR /&gt;value = value.replace(/\D/g, ''); // Remove non-numeric characters&lt;BR /&gt;var Soma;&lt;BR /&gt;var Resto;&lt;BR /&gt;Soma = 0;&lt;BR /&gt;if (value == "00000000000") return false; // Check for invalid CPF (e.g., 000.000.000-00)&lt;BR /&gt;if (value == "11111111111") return false; // Check for invalid CPF (e.g., 111.111.111-11)&lt;BR /&gt;if (value == "22222222222") return false; // Check for invalid CPF (e.g., 222.222.222-22)&lt;BR /&gt;if (value == "33333333333") return false; // Check for invalid CPF (e.g., 333.333.333-33)&lt;BR /&gt;if (value == "44444444444") return false; // Check for invalid CPF (e.g., 444.444.444-44)&lt;BR /&gt;if (value == "55555555555") return false; // Check for invalid CPF (e.g., 555.555.555-55)&lt;BR /&gt;if (value == "66666666666") return false; // Check for invalid CPF (e.g., 666.666.666-66)&lt;BR /&gt;if (value == "77777777777") return false; // Check for invalid CPF (e.g., 777.777.777-77)&lt;BR /&gt;if (value == "88888888888") return false; // Check for invalid CPF (e.g., 888.888.888-88)&lt;BR /&gt;if (value == "99999999999") return false; // Check for invalid CPF (e.g., 999.999.999-99)&lt;/P&gt;&lt;P&gt;// CPF first check digit&lt;BR /&gt;for (i = 1; i &amp;lt;= 9; i++) Soma = Soma + parseInt(value.substring(i - 1, i)) * (11 - i);&lt;BR /&gt;Resto = (Soma * 10) % 11;&lt;BR /&gt;if ((Resto == 10) || (Resto == 11)) Resto = 0;&lt;BR /&gt;if (Resto != parseInt(value.substring(9, 10))) return false;&lt;/P&gt;&lt;P&gt;// CPF second check digit&lt;BR /&gt;Soma = 0;&lt;BR /&gt;for (i = 1; i &amp;lt;= 10; i++) Soma = Soma + parseInt(value.substring(i - 1, i)) * (12 - i);&lt;BR /&gt;Resto = (Soma * 10) % 11;&lt;BR /&gt;if ((Resto == 10) || (Resto == 11)) Resto = 0;&lt;BR /&gt;if (Resto != parseInt(value.substring(10, 11))) return false;&lt;/P&gt;&lt;P&gt;return true;&lt;BR /&gt;}, 'Coloque um CPF válido.');&lt;/P&gt;&lt;P&gt;// Apply CPF validation to the field&lt;BR /&gt;jQuery("#guestUser\\.fieldValues\\.ui_cpf_text").rules("add", { validaCPF: true });&lt;/P&gt;&lt;P&gt;// CPF Formatting: Apply mask as XXX.XXX.XXX-XX&lt;BR /&gt;$("#guestUser\\.fieldValues\\.ui_cpf_text").on("input", function() {&lt;BR /&gt;if ($(this).val().length &amp;gt; 14) {&lt;BR /&gt;$(this).val($(this).val().substring(0, 14)); // Limit length to 14 (XXX.XXX.XXX-XX format)&lt;BR /&gt;}&lt;BR /&gt;let value = $(this).val().replace(/[^0-9]/g, "")&lt;BR /&gt;.replace(/^([\d]{3})([\d]{3})?([\d]{3})?([\d]{2})?/, "$1.$2.$3-$4");&lt;BR /&gt;$(this).val(value); // Apply formatted value&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// Phone Validation: Phone number format (XXX) XXXXX-XXXX&lt;BR /&gt;jQuery("#guestUser\\.fieldValues\\.ui_phone_number").attr("placeholder", "(XX)9XXXX-XXXX");&lt;BR /&gt;jQuery("#guestUser\\.fieldValues\\.ui_phone_number").attr("type", "number");&lt;BR /&gt;setTimeout(function(){&lt;BR /&gt;cisco.ise.validation.setPhoneRegex (/^\(?(\d{2})\)?(\d{5})[- ]?(\d{4})$/);&lt;BR /&gt;cisco.ise.validation.setPhoneNumberMessage("Informe seu numero de celular (XX)9XXXX-XXXX");&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// Form submission handler&lt;BR /&gt;$("#selfRegForm").validate({&lt;BR /&gt;rules: {&lt;BR /&gt;"#guestUser\\.fieldValues\\.ui_cpf_text": {&lt;BR /&gt;required: true,&lt;BR /&gt;validaCPF: true&lt;BR /&gt;},&lt;BR /&gt;"#guestUser\\.fieldValues\\.ui_phone_number": {&lt;BR /&gt;required: true,&lt;BR /&gt;minlength: 14, // Minimum length for phone number (formatted as (XX) XXXXX-XXXX)&lt;BR /&gt;maxlength: 14&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;messages: {&lt;BR /&gt;"#guestUser\\.fieldValues\\.ui_cpf_text": {&lt;BR /&gt;required: "Por favor, CPF requerido. Insira seu CPF.",&lt;BR /&gt;validaCPF: "Por favor, CPF inválido. insira um CPF válido."&lt;BR /&gt;},&lt;BR /&gt;"#guestUser\\.fieldValues\\.ui_phone_number": {&lt;BR /&gt;required: "Por favor, telefone requerido. Insira um número de telefone.",&lt;BR /&gt;minlength: "Por favor, insira um número de caracteres maior de telefone para ser válido.",&lt;BR /&gt;maxlength: "Por favor, insira um número de caracteres menor de telefone para ser válido"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;// If validation fails, prevent form submission&lt;BR /&gt;submitHandler: function(form) {&lt;BR /&gt;form.submit(); // Submit the form if all fields are valid&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}, 50);&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 13:57:28 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/cisco-ise-2-4-guest-portal-cpf-field-validation-with-javascript/m-p/5282749#M596008</guid>
      <dc:creator>rogerf100</dc:creator>
      <dc:date>2025-04-18T13:57:28Z</dc:date>
    </item>
  </channel>
</rss>

