www.webdeveloper.com
Results 1 to 2 of 2

Thread: HTML Drop Down Menu Questions

  1. #1
    Join Date
    Feb 2014
    Posts
    1

    HTML Drop Down Menu Questions

    I am trying to make a customized search on my website to search the year with car model

    I really don't need these drop down menu to be dynamic, so I've made these drop downs list like

    Code:
    <form method="get" id="searchform" action="http://store.ijdmtoy.com/-s/146.htm">
        <INPUT TYPE=HIDDEN NAME="searching" VALUE="Y">
        <p>
            <select size="1" name="Search">
                <option>2014</option>
                <option>2013</option>
                <option>2012</option>
                <option>2011</option>
                <option>2010</option>
                <option>2009</option>
                <option>2008</option>
                <option>2007</option>
                <option>2006</option>
                <option>2005</option>
                <option>2004</option>
                <option>2003</option>
                <option>2002</option>
                <option>2001</option>
                <option>2000</option>
            </select>
    
            <select size="1" name=" ">
                <option>TSX</option>
                <option>MDX</option>
                <option>RDX</option>
                <option>RSX</option>
                <option>NSX</option>
                <option>ZDX</option>
            </select>
    
            <input type="submit" value="Search" name="">
        </p>
    </form>
    However, when I run this search using selection for example chosen 2011 and TSX, it will return

    http://store.ijdmtoy.com/Acura-LED-I...rch=2011&+=TSX

    Instead of how I wanted like

    http://store.ijdmtoy.com/Acura-LED-I...earch=2011+TSX



    There are "&" and "=" in the code, so I want to know how can I write it to get rid of these two symbols?

  2. #2
    Join Date
    Mar 2012
    Posts
    1,246
    The "&" and "=" are standard syntax. As far as I'm aware it is not optional. And the "+" is a place marker because you have not named the second select. You should:
    1. Name the two selects. E.g. "year" and "model".
    2. Amend the code processing the form input to concatenate the two parameters into the format you require. E.g. In PHP I'd code something like:

    <?php
    if( isset($_POST['year'])) {
    $input=$_POST['year'].'+'.$_POST['model'];
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles