Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8305911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:13:26+00:00 2026-06-08T18:13:26+00:00

I am a newbie in classic asp . I want CPF validation function in

  • 0

I am a newbie in classic asp . I want CPF validation function in classic asp.

Following links have CPF validation functions in javascript and vb.net but I want it in classic asp /vbscript

http://codigofonte.uol.com.br/codigo/js-dhtml/validacao/validar-cpf-via-javascript

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3811&lngWId=10

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:13:27+00:00Added an answer on June 8, 2026 at 6:13 pm

    Finally , I have managed to write a vbscript function myself. It may help someone in future.

    function ValidateCPFNew(cpf)
        Dim multiplic1, multiplic2
        multiplic1=Array(10, 9, 8, 7, 6, 5, 4, 3, 2)
        multiplic2=Array(11, 10, 9, 8, 7, 6, 5, 4, 3, 2 )
        Dim tempCpf,digit,sum,remainder,i,RegXP
        cpf = Trim(cpf)
        cpf = Replace(cpf,".", "")
        cpf = Replace(cpf,"-", "")
        if (Len(cpf) <> 11) Then
            ValidateCPFNew = false
        else
            tempCpf = Left (cpf, 9)
            sum = 0
    
            Dim intCounter
            Dim intLen 
            Dim arrChars()
    
            intLen = Len(tempCpf)-1
            redim arrChars(intLen)
    
            For intCounter = 0 to intLen
                arrChars(intCounter) = Mid(tempCpf, intCounter + 1,1)
            Next
    
            i=0
            For i = 0 to 8
                sum =sum + CInt(arrChars(i)) * multiplic1(i)
            Next
    
            remainder = sum Mod 11
            If (remainder < 2) Then
                remainder = 0
            else
                remainder = 11 - remainder
            End If
    
            digit = CStr(remainder)
            tempCpf = tempCpf & digit
            sum = 0
    
            intLen = Len(tempCpf)-1
            redim arrChars(intLen)
            intCounter= 0
            For intCounter = 0 to intLen
                arrChars(intCounter) = Mid(tempCpf, intCounter + 1,1)
            Next
            i=0
            For i = 0 to 9
                sum =sum + CInt(arrChars(i)) * multiplic2(i)
            Next        
            remainder = sum Mod 11
    
            If (remainder < 2) Then
                remainder = 0
            else
                remainder = 11 - remainder
            End If      
            digit = digit & CStr(remainder)
    
            Set RegXP=New RegExp
                RegXP.IgnoreCase=1
                RegXP.Pattern=digit & "$"
    
            If RegXP.test(cpf) Then 
                ValidateCPFNew = true
            else
                ValidateCPFNew = false
            end if
        end if
    end Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Willing to admit I'm a complete .NET newbie, but I have extensive experience in
Newbie question i have following function: function isadult($description) { $bad=/*comma separated bad words*/; $bad=explode(,,$bad);
Newbie question: There are three types of Asp.Net controls : HTML server controls, Web
Newbie here. The following function works fine when $color refers to an entry in
Newbie question here but for some reason I cant figure this out. I have
anyone please help me to do searching in ASP classic(inventory system)..i newbie in programming
I'm newbie here and try to learn here. I wanna create a Classic asp
Newbie Warning I have a simple but vexing problem trying to disable an NSButton.
A newbie question. Arrays in C# return a non generic (classic) IEnumerator. Other collections
newbie here, so thanks in advance for help! I have a Wordpress site with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.