Connecting Tech Pros Worldwide Help | Site Map

Tax/VAT Number Validation Script

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 11:25 AM
Laphan
Guest
 
Posts: n/a
Default 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



  #2  
Old July 23rd, 2005, 11:25 AM
Lee
Guest
 
Posts: n/a
Default 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.

  #3  
Old July 23rd, 2005, 11:25 AM
Dr John Stockton
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.