Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validate input in a form based on a list?

Status
Not open for further replies.

conneticat

Programmer
Jul 16, 2004
47
US
Is there a simple way to make a field on a registration form comply to a hidden list? I want to limit the zipcodes that can be entered on my form to those in my list...all 439 of them. I don't want to have a huge drop down list, however. Any SIMPLE solution? I can't muck around with javascript, fancy code, etc. right now because my brain has no free space and needs defragging.

cat.gif
 
why not just a simple list with size limit.
Code:
<form id="form1" name="form1" method="post" action="">
  <label for="my_list">state:</label>
  <select name="idddd" size="5" id="idddd">
    <option value="AL">ALABAMA</option>
    <option value="AK">ALASKA</option>
    <option value="AS">AMERICAN SAMOA</option>
    <option value="AL">ALABAMA</option>
    <option value="AK">ALASKA</option>
    <option value="AS">AMERICAN SAMOA</option>
    <option value="AL">ALABAMA</option>
    <option value="AK">ALASKA</option>
    <option value="AS">AMERICAN SAMOA</option>
    <option value="AL">ALABAMA</option>
    <option value="AK">ALASKA</option>
    <option value="AS">AMERICAN SAMOA</option>
  </select>
</form>
no need to for javascript or anything....
you could then use javascript to requie the field or better yet server side PHP,ASP etc..

:-------------------------------------:
Do the DW »|MostarNetworks|
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top