PassMark Logo
Home » Forum


No announcement yet.

Select field and exact search terms

  • Filter
  • Time
  • Show
Clear All
new posts

  • Select field and exact search terms

    I'm trying to use a select field, but search the exact terms.
    Here is my sample page:

    I've tried this code and get to many results - specifically with the Cardiovascular Disease.

    <form action=" Search/search.php" method="get"><input class="search-btn" type="submit" value="Go" />
    <select class="search-input" name="zoom_query" id="select">
    <option value="Anesthesiology">Anesthesiology</option>
    <option value="Cardiovascular Disease">Cardiovascular Disease</option>
    <option value="Clinical Pathology & Anatomic Pathology">Clinical Pathology & Anatomic Pathology</option>
    <option>Critical Care Medicine</option>

    I tried changing it to this:
    <option value=""Cardiovascular Disease"">Cardiovascular Disease</option>
    But get "no search query entered".

    If I search the text box for "Cardiovascular Disease" I get the results I would like to get from the select menu.

    Any ideas?

  • #2
    Try HTML encoding the quotes to get the exact phrase search working in the drop down.

    Like this,
    <option value="&quot;Cardiovascular Disease&quot;">Cardiovascular Disease</option>