Announcement

Collapse
No announcement yet.

Validation of a VAT number input

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Validation of a VAT number input

    Is there a solution to validate a VAT number from a customer from the EU?

    When they input it? Seems quite important to have with regards liability to a wrong number (Not to the correct format) and the boss has requested it.

    So far i have found this interesting javascript that might be use:
    http://www.braemoor.co.uk/software/vat.shtml

    But am unsure how to incorporate it to the next button and error code.

    Can anyone help
    www.polymax.co.uk/acatalog/ number 1 for for o-rings, rubber seals, rubber cords. In Viton NBR and silicone.
    Cuddle And Carry, Baby Slings Wraps Ringslings Pouches and Carriers
    http://www.oringen.eu/ O-Ringen Rubber Koord Uitegdreven Profielen in Nitrile (NBR) Viton.

    #2
    bump bump bump
    www.polymax.co.uk/acatalog/ number 1 for for o-rings, rubber seals, rubber cords. In Viton NBR and silicone.
    Cuddle And Carry, Baby Slings Wraps Ringslings Pouches and Carriers
    http://www.oringen.eu/ O-Ringen Rubber Koord Uitegdreven Profielen in Nitrile (NBR) Viton.

    Comment


      #3
      This was just discussed a few days ago...have a search around

      Comment


        #4
        I did, I can see this but the thread was some what off topic as the user had a different error.

        Here: http://community.actinic.com/showthr...ght=VAT+number

        I can't believe that no one has a solution for this, there must be some JavaScript some where that says something along these lines (or integrated with the link above):

        if lstDeliveryCountry == Austria then TAXEXEMPT1 format must be = U********
        else if

        if lstDeliveryCountry == Belgiumthen TAXEXEMPT1 format must be = *********

        Etc full VAT number verification formats can be found here:
        http://pages.ebay.co.uk/help/account/vat-id.html


        Especially when the government says: It is the seller's responsibility to check the validity of the VAT Number submitted.


        Anyone?
        www.polymax.co.uk/acatalog/ number 1 for for o-rings, rubber seals, rubber cords. In Viton NBR and silicone.
        Cuddle And Carry, Baby Slings Wraps Ringslings Pouches and Carriers
        http://www.oringen.eu/ O-Ringen Rubber Koord Uitegdreven Profielen in Nitrile (NBR) Viton.

        Comment


          #5
          As I said in the other thread, I've never come across any ecommerce shopping cart software which offers this functionality. I would say you're going to need a lot of pennies to get this customised in to any software.

          Comment


            #6
            For a script to do this, you would need access to the equivalent of the individual countries' HMRC databases. Not gonna happen, is it.
            Reusable Snore Earplugs : Sample Earplugs - Wax Earplugs - Women's Earplugs - Children's Earplugs - Music Earplugs - Sleep Masks

            Comment


              #7
              Originally posted by James13009 View Post

              But am unsure how to incorporate it to the next button and error code.
              Try this
              first download the javascript from the web site you mentioned and install to your site folder

              in design mode select checkout page 1

              insert this just before </head>
              Code:
              	 <script language="javascript" type="text/javascript" src="jsvat.js"></script>
              just after the line
              Code:
              <body onload="<actinic:variable name="OnLoadScript" value="PreloadImages" />">
              insert this
              Code:
              <script>
              function testVATNumber () {
                var myVATNumber = document.getElementById('vatnumber').value;
                if (checkVATNumber (myVATNumber)) {
                  document.getElementById('vatnumber').value = checkVATNumber (myVATNumber)
                  alert ("VAT number has a valid format"); 
                }  
                else alert ("VAT number has an invalid format");
              }
              </script>
              now in layout advanced tax 1 exempt prompt change the second input line to
              Code:
               <input id="vatnumber" type="text" name="TAXEXEMPT1DATA" size="30" value="<actinic:variable name="TaxExempt1Data" />" onchange="testVATNumber();"/>
              Test it on the page using 'Preview Currect Page', the code checks the number entered when you tab out of the entry box

              The javascript only checks that the number is in the correct format it does not check that it is valid for the company. For a UK vat number the last two digits are a check number which it does validate so just any old number is not going to work, I haven't examined all the other checks in the javascript code but it looks comprehensive.

              Malcolm

              SellerDeck Accredited Partner,
              SellerDeck 2016 Extensions, and
              Custom Packages

              Comment


                #8
                ^ Great bit of help thanks very much. I have it all up and working now modified the script slightly to take into account blank fields. Also I have added disable/enable the next button depend on the out come of the if statement. See below

                Code:
                <script>
                function testVATNumber () {
                  var myVATNumber = document.getElementById('vatnumber').value;
                  if (checkVATNumber (myVATNumber)) 
                {
                    document.getElementById('vatnumber').value = checkVATNumber (myVATNumber) 
                    document.form1.NextButton.disabled=false;
                    
                  
                  }  
                  else if ( document.getElementById('vatnumber').value == '' )
                    {
                        document.form1.NextButton.disabled=false;
                    }
                  else {alert ("VAT number has an invalid format, please check the number."); document.form1.NextButton.disabled=true;}
                }
                </script>
                And the checkout next button (Also renamed the form, form1)

                Code:
                <input type="submit" name="ACTION" value="<actinic:variable encoding="html" name="NextButton" />" name="NextButton" id="NextButton"  />
                again thanks for your help
                www.polymax.co.uk/acatalog/ number 1 for for o-rings, rubber seals, rubber cords. In Viton NBR and silicone.
                Cuddle And Carry, Baby Slings Wraps Ringslings Pouches and Carriers
                http://www.oringen.eu/ O-Ringen Rubber Koord Uitegdreven Profielen in Nitrile (NBR) Viton.

                Comment

                Working...
                X