954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Server side validation on Zip code field

I have been trying to get javascript to work for this but no luck. What I am needing is: I have a drop down box for a person to select COUNTRY either US or Canadian. If it is US then I need a zip code box to display and validate zip for US. If they select Canada I need the same box to validate for Canadian zip code. Any ideas or help with this would be very much appreciated. Can this be done in .asp? If not I can send the javascript code that I can't get to work if that would help.

<select name="COUNTRY" id="COUNTRY">
                <option value="United States">United States</option>
                <option value="Canada">Canada</option>
              </select>

<input name="ZIP" type="text" id="ZIP" size="7" maxlength="10" />
ammwebmaster2
Newbie Poster
6 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

instead of textbox make the zip field a combobox and it's values will depend on what country you select.. you can do this thru javascipt..in this case you don't need to validate zip info...

jcarbillon
Light Poster
43 posts since Aug 2011
Reputation Points: 10
Solved Threads: 2
 

So what you are saying is build a selection list that contains all the US zip codes and then one with all Canadian zip codes?

ammwebmaster2
Newbie Poster
6 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 



Country :
Choose OneCanadaUSA


Zipcode :

jcarbillon
Light Poster
43 posts since Aug 2011
Reputation Points: 10
Solved Threads: 2
 

Thank you so much I will see what I can do with this code. I will have to create a selection list with all the zip codes which will take quite some time to do and find a list for Canadian zips to put with the US.

ammwebmaster2
Newbie Poster
6 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You