469,304 Members | 2,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

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
Jul 23 '05 #1
2 4024
Lee
Laphan said:

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.


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.

Jul 23 '05 #2
JRS: In article <40**********@127.0.0.1>, seen in
news:comp.lang.javascript, Laphan <ne**@DoNotEmailMe.co.uk> posted at
Sun, 6 Jun 2004 12:45:33 :

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


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.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Phil Powell | last post: by
16 posts views Thread by Hosh | last post: by
6 posts views Thread by Nedu N | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.