Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8074635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:43:16+00:00 2026-06-05T14:43:16+00:00

I am currently trying to create a search based on multiple dropdowns. The snippet

  • 0

I am currently trying to create a search based on multiple dropdowns.

The snippet I use is the following:

    <script type="text/javascript" charset="utf-8">
        function add_criteria (el) {
            search = document.getElementById('search_criteria');
            search.value = document.getElementById('type').value + " " + document.getElementById('color').value;}
    </script>

    <form role="search" method="get" id="searchform" action="search.html?submit=Go&_nkw">
        <label class="screen-reader-text" for="s">Search for:</label>
    Type
    <select name='type' id='type' class='postform' onchange="add_criteria(this);">
      <option value='' selected='selected'>All</option>
      <option class="level-0" value="dog">Dog</option>
      <option class="level-0" value="cat">Cat</option>
    </select> 

    Color
    <select name='color' id='color' class='postform' onchange="add_criteria(this);">
      <option value='' selected='selected'>All</option>
      <option class="level-0" value="red">red</option>
      <option class="level-0" value="white">white</option>
      <option class="level-0" value="green">green</option>
    </select> 
       <input type="submit" id="searchsubmit" value="Search" />
      </div>
    </form> 

The result however is not correct – what I would like to achieve is the result being displayed in this fashion:

    http://mystore.com/search.html?submit=Go&_nkw=medium+red

Does anybody have an idea on how I can get this replacement sting fixed and properly working?

Some advise would be highly appreciated – thank you very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:43:19+00:00Added an answer on June 5, 2026 at 2:43 pm

    Well, you need just a simple trick. First of all get those <select> tags out of <form> tag, and make two fake <input> with name submit and _nkw (thats how <form> element works):

    <!DOCTYPE html>
    <html>
    <body>
    
    <script type="text/javascript" charset="utf-8">
            function add_criteria (el) {
                search = document.getElementById('search_criteria');
                search.value = document.getElementById('type').value + " " + document.getElementById('color').value;}
        </script>
    
          <div>
            <select name='type' id='type' class='postform' onchange="add_criteria(this);">
                <option value='' selected='selected'>All</option>
                <option class="level-0" value="dog">Dog</option>
                <option class="level-0" value="cat">Cat</option>
            </select> 
    
            Color
            <select name='color' id='color' class='postform' onchange="add_criteria(this);">
                <option value='' selected='selected'>All</option>
                <option class="level-0" value="red">red</option>
                <option class="level-0" value="white">white</option>
                <option class="level-0" value="green">green</option>
            </select>
            </br>
            <form role="search" method="get" id="searchform" action="search.html">
                <input name="submit" value="Go" style="visibility:hidden;"></label>
                <input id="search_criteria" name="_nkw" value="" style="visibility:hidden;"></label>
                <input type="submit" id="searchsubmit" value="Search" />
            </form>
          </div>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to create a program that estimates location based on signal strength.
I am currently trying to create a site that filter the content based on
I'm trying to make a generic javascript dialog-class based on JQuery to create div-popups
I'm trying to create a search engine for our library. Currently I have table
i am trying to create a Ajax live search for my website. I currently
I'm currently trying to create a load test for my API using soapUI to
I am currently trying to create a function which will allow me to pass
I'm currently trying to create a desktop like homepage where using can move around
I am currently trying to create an Android application that loops Audio from the
I'm currently trying to create a subclass of UIImageView in order to make it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.