The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML Form with array for Zip code validation, HTML Form with array for Zip code validation
vdesign24
post Sep 9 2009, 01:02 PM
Post #1





Group: Members
Posts: 4
Joined: 9-September 09
Member No.: 9,708



I am trying to create a HTML form with one form field. Zip Code. When a user enters in there zip, I would like to have an array or something validate that the entered value is within my set zip code range. If the zip entered is within the range it will forward them to a certain link to continue, if not they will be forwarded to the "sorry" page.

Any help is greatly appreciated!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Sep 9 2009, 10:56 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



You need a script for handling the form that checks if the ZIP code is in the required range. HTML can't "do it".
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
vdesign24
post Sep 10 2009, 12:16 AM
Post #3





Group: Members
Posts: 4
Joined: 9-September 09
Member No.: 9,708



QUOTE(Brian Chandler @ Sep 9 2009, 10:56 PM) *

You need a script for handling the form that checks if the ZIP code is in the required range. HTML can't "do it".



What would you recommend and do you have anything you could share?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
vdesign24
post Sep 10 2009, 12:31 AM
Post #4





Group: Members
Posts: 4
Joined: 9-September 09
Member No.: 9,708



I a familiar with php and some coding, however I would like to find a way to accomplish this without accessing the database. That is possible right?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
vdesign24
post Sep 29 2009, 11:21 AM
Post #5





Group: Members
Posts: 4
Joined: 9-September 09
Member No.: 9,708



Below is the code I have for the form. Basically what I need is the coding to incorporate into this as well as an external php file if necessary to process.

If zip code entered is within the set range they will get a message saying you are able to continue with order. Or congratulations. If not within the range they would get an message saying you are not within set zip range and cannot place an order.

<div align="left">Type your zip code below to make sure you are within range of purchase.

</div>
<form name="zip" onSubmit="return validateZIP(this.zip.value)">
<div align="left">Zip:
<input type="text" size="30" name="zip">
<input type="submit" value="Submit">
</div>
</form>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 10:35 PM