Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pull Down submit

    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?

  • #2
    Regular Coder croatiankid's Avatar
    Join Date
    Jan 2006
    Posts
    665
    Thanks
    1
    Thanked 12 Times in 12 Posts
    If you're asking how to make a dropdown list, like this:
    <select>
    <option>state1</option>
    <option>state2</option>
    </select>

  • #3
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No I'm not. I know that part.

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

    Code:
      <table width="360" height="137" border="0">
        <tr>
          <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>Alaska</option>
                <option>Arizona</option>
                <option>Arkansas</option>
                <option>California</option>
                <option>Colorado</option>
                <option>Connecticut</option>
                <option>Delaware</option>
                <option>Florida</option>
                <option>Georgia</option>
                <option>Hawaii</option>
                <option>Idaho</option>
                <option>Illinois</option>
                <option>Indiana</option>
                <option>Iowa</option>
                <option>Kansas</option>
                <option>Kentucky</option>
                <option>Louisiana</option>
                <option>Maine</option>
                <option>Maryland</option>
                <option>Massachusetts</option>
                <option>Michigan</option>
                <option>Minnesota</option>
                <option>Mississippi</option>
                <option>Missouri</option>
                <option>Montana</option>
                <option>Nebraska</option>
                <option>Nevada</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>Ohio</option>
                <option>Oklahoma</option>
                <option>Oregon</option>
                <option>Pennsylvania</option>
                <option>Rhode Island</option>
                <option>South Carolina</option>
                <option>South Dakota</option>
                <option>Tennessee</option>
                <option>Texas</option>
                <option>Utah</option>
                <option>Vermont</option>
                <option>Virginia</option>
                <option>Washington</option>
                <option>Washington D.C.</option>
                <option>West Virginia</option>
                <option>Wisconsin</option>
                <option>Wyoming</option>
              </select>
              </label>
            </form>
          </td>
        </tr>
    <tr>
          <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" />
              </label>
          </form>        <label></label></td>
        </tr>
        <tr>
          <td height="26"><form id="submit" name="submit" method="post" action="">
            <label>
              <input type="submit" name="submit" id="submit" value="Submit" tabindex="3" />
              </label>
          </form>
            <label></label></td>
        </tr>
      </table>
    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.
    Last edited by DaKKie; 02-26-2008 at 08:30 PM.

  • #4
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    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.
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #5
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    So, you haven't designed a database yet?
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #7
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, I haven't done anything except what you see above. because I'm trying to figure out the best way of doing this.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •