Tax/VAT Number Validation Script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laphan

    Tax/VAT Number Validation Script

    Hi All

    I'm after a Tax/VAT number validation script that I can tag onto the onClick
    event of my submit button before submission.

    I've seen a lot of these as server side, but I'm trying to keep things like
    this as client-side, as I personally hate having to wait for the submission
    to go through and then finding I've missed a field off.

    I have a country <SELECT> menu with the ISO country codes as the OPTION
    VALUE so if there has to be check on the country code before the validation
    can work then I have this to hand.

    I just need to validate such as IE 4883 939 L as an entered code for
    Ireland.

    Has anybody seen one of these what they can point me to?

    Thanks

    Laphan


  • Lee

    #2
    Re: Tax/VAT Number Validation Script

    Laphan said:[color=blue]
    >
    >Hi All
    >
    >I'm after a Tax/VAT number validation script that I can tag onto the onClick
    >event of my submit button before submission.
    >
    >I've seen a lot of these as server side, but I'm trying to keep things like
    >this as client-side, as I personally hate having to wait for the submission
    >to go through and then finding I've missed a field off.[/color]

    1. Don't perform validation in the onClick event of a submit
    button. Use the onSubmit event of the form. That's what
    it's for. If the onSubmit handler returns false, the form
    will not be submitted. eg, onsubmit="retur n validate(this)" .

    2. As I understand it, UK VAT number validation is trivial,
    but that's not true in the general case, so performing
    the validation on the client could easily mean downloading
    enough data and code that you end adding more time for the
    page to load than you currently wait for validation.

    Comment

    • Dr John Stockton

      #3
      Re: Tax/VAT Number Validation Script

      JRS: In article <40c2fff3$1_3@1 27.0.0.1>, seen in
      news:comp.lang. javascript, Laphan <news@DoNotEmai lMe.co.uk> posted at
      Sun, 6 Jun 2004 12:45:33 :[color=blue]
      >
      >I just need to validate such as IE 4883 939 L as an entered code for
      >Ireland.[/color]

      Firstly, you need to define exactly what you mean by "such as".

      <URL:http://www.merlyn.demo n.co.uk/js-valid.htm>

      --
      © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
      <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
      <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
      <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

      Comment

      Working...