Connecting Tech Pros Worldwide Help | Site Map

Tax/VAT Number Validation Script

Laphan
Guest
 
Posts: n/a
#1: Jul 23 '05
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
Guest
 
Posts: n/a
#2: Jul 23 '05

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="return 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.

Dr John Stockton
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Tax/VAT Number Validation Script


JRS: In article <40c2fff3$1_3@127.0.0.1>, seen in
news:comp.lang.javascript, Laphan <news@DoNotEmailMe.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.demon.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.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Closed Thread