Search code Problem

Discussion in 'C#' started by Alistair, Apr 12, 2007.

  1. #1
    Hi
    I want to add a drop down bar with a selection of UK postal codes to aid people with a distance search on my ASP classifieds site.

    This is the original search code which works fine:

    <form action="advsearch.asp" name="zsearch" method="get" style="margin:0;">
    <b>Search For Ads within:</b><br>
    <select size="1" name="RDM" class="forms" style="margin-top: 3; margin-bottom: 3;">
    <option value="1">Radius of 1 Km</option>
    <option value="5">Radius of 5 Km</option>
    <option selected value="10">Radius of 10 Km</option>
    <option value="25">Radius of 25 Km</option>
    <option value="50">Radius of 50 Km</option>
    <option value="75">Radius of 75 Km</option>
    <option value="100">Radius of 100 Km</option>
    </select> <br>
    <b>From Postcode:</b>
    <div><input maxlength="5" type="text" size="4" class="forms" name="zipr"></div><br>
    <br>
    <input type="hidden" name="D1" value="0">
    <input type="hidden" name="D4" value=1>
    <input type="hidden" name="zipOpt" value=13>
    <input type="hidden" name="dosearch" value="dosearch">
    <input type="submit" value="Search Ads" name="B1" class="buttons">
    </form>

    I want it to include something like below and remove the text area to make a drop down search with different postcodes included:

    <b>From Postcode:</b>
    <div><select>
    <option value="Td1">TD1</option>
    <option value="TD9">TD9</option>
    <option value="SW50">SW50</option>
    </select>

    When I do this it comes up with no search results? any ideas where I am going wrong?

    Thanks

    Alistair
     
    Alistair, Apr 12, 2007 IP
  2. webcosmo

    webcosmo Notable Member

    Messages:
    5,840
    Likes Received:
    153
    Best Answers:
    2
    Trophy Points:
    255
    #2
    that sounds like a coding issue on the backend. can u post the script?
     
    webcosmo, Apr 12, 2007 IP
  3. briansol

    briansol Well-Known Member

    Messages:
    221
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #3
    most liekly, instead of
    WHERE zip = request("zip")
    you need to use
    WHERE left(zip,3) = left(request("zip"),3)



    also, you have no name in your new select option... that won't pass to the processor
     
    briansol, Apr 13, 2007 IP