View Full Version : Pull Down submit

02-26-2008, 08:00 PM
I need a little help here. I want to start a search and I want to start out with state and zip code. So I have a pull down with every state and D.C. and then I have a text area for the user to type in their zip code in that certain state.

I'm wondering what the easiest and most effective way to do this is. I was thinking of making a table that has 51 rows the the states and D.C. Then I'm thinking that's bogus. All I need to do it when the person chooses the states in the pulldown it posts that into the database and when they type there zip code and press submit it narrows down the search to jut their town/city or says wrong zip code or something.

Could someone help me? Please?

02-26-2008, 08:14 PM
If you're asking how to make a dropdown list, like this:

02-26-2008, 08:28 PM
No I'm not. I know that part.

It's hard to ask in words. Uhh....

<table width="360" height="137" border="0">
<td height="29"><label></label>
<form id="state" name="state" method="post" action="">
<label><span class="style3">State</span>
<select name="State" id="State" tabindex="1">
<option selected="selected">Alabama</option>
<option>New Hampshire</option>
<option>New Jersey</option>
<option>New Mexico</option>
<option>New York</option>
<option>North Carolina</option>
<option>North Dakota</option>
<option>Rhode Island</option>
<option>South Carolina</option>
<option>South Dakota</option>
<option>Washington D.C.</option>
<option>West Virginia</option>
<td height="29"><form id="zip" name="zip" method="post" action="">
<label><span class="style3">Zip Code</span>
<input name="zip" type="text" id="zip" tabindex="2" size="10" maxlength="5" />
</form> <label></label></td>
<td height="26"><form id="submit" name="submit" method="post" action="">
<input type="submit" name="submit" id="submit" value="Submit" tabindex="3" />
Now from there with the pull down text area and button. I the user to be able to choose a state and then type in their zip code and show a certain page.

02-26-2008, 09:18 PM
OK, you have the form. It looks fine. However you have not stated (i)what query you are going to search with and (ii)how state and zip are intended to filter results. It would also be handy to see the relevant database table structures.

02-26-2008, 09:25 PM
Ok well what I'm trying to figure out is the best way, starting with the form.

What I want to search is certain cars in the cities/towns from the state. So say I'm looking for a Acura RSX 2005, and I live in NY and my zip is whatever one of their zip codes are. I pull down to New York and type my cities zip in. and it finds all the Acura RSX in that city, and I'll go on later to maybe add miles away from that zip and so on. So I just need to know the best way to do it.

02-27-2008, 12:15 AM
So, you haven't designed a database yet?

02-28-2008, 04:36 PM
No, I haven't done anything except what you see above. because I'm trying to figure out the best way of doing this.