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 7844871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:02:14+00:00 2026-06-02T17:02:14+00:00

I am using the Harvest Chosen jQuery plugin successfully to create a drop down

  • 0

I am using the Harvest Chosen jQuery plugin successfully to create a drop down single selection list with a submit button on a WordPress site. This is connected up to display all terms from a given taxonomy, and allows a user to choose a term and then press a submit button to load the corresponding page relating to the selected term.

I am now trying to get the plugin to work with multiple selections of terms from the taxonomy. I have the selection working and on the front-end a user can select multiple terms, but I cannot figure out how to submit the multiple selections.

I know my code is missing something, but I can’t figure out what needs modifying to allow multiple terms to be selected.

This is what I have so far:

<form action="<?php bloginfo('url'); ?>">
<div>
<?php
function get_terms_dropdown($taxonomies, $args){
    $myterms = get_terms($taxonomies, $args);
    $output ="<select name='topics' class='chosen' style='width:500px' multiple='true'>";
    foreach($myterms as $term){
        $root_url = get_bloginfo('url');
        $term_taxonomy = $term->taxonomy;
        $term_slug = $term->slug;
        $term_name = $term->name;
        $link = $term_slug;
        $output .="<option value='".$link."'>".$term_name."</option>";

}
    $output .="</select>";
return $output;
}

$taxonomies = array('topics');
$args = array();
echo get_terms_dropdown($taxonomies, $args);

?>
<div><input type="submit" value="Filter" /></div>
</div>
</form>

Ordinarily, for multiple selections, the URL structure would look like the following for an ‘AND’ query:

domain.com/?topics=topic1+topic2+topic3

OR the following for an ‘OR’ query:

domain.com/?topics=topic1,topic2,topic3

Getting either of these options would work for now (I eventually intend to add an option for AND/OR searches)

Any help or pointers in the right direction to get this working would be great.

  • 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-02T17:02:16+00:00Added an answer on June 2, 2026 at 5:02 pm

    When you submit the form, you could build the URL with JavaScript and change the page with something like:

    $('form').submit( function() {
        var selectArray = $('select').val();
        var newURL = "http://domain.com/?topics=";
        for (var i = 0; i < selectArray.length; i++) {
            if ( 1 != 0 ) {
                newURL += "+";
            }
            newURL += selectArray[i];
        }
        window.location = newURL;
    });
    

    Breakdown: $('form').submit( function() { [...] }); gets fired when a form is submitted. You would want to qualify this with a class $('form.yourClass') or ID $('form#yourID') unique to your form.

    $('select').val() will return an array of the selected values for a selet element. It should be qualified in the same way as the form with a class $('select.yourClass') or an ID $('select#yourID'). The JavaScript goes through the array and appends each value to the root URL of http://domain.com/?topics= with a + in between each value. Once it is done, the user is redirected to the new URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jQuery plugin chosen (by Harvest). It is working fine on
I am using jQuery to slide a sign in box down when the user
using the jquery ui modal dialog , the background shades grey (i assuming this
Using VBScript, I want to add an additional button to Notepad labeled send .
I am working on a comment script using ajax, json and jquery. I have
How would you integrate Subversion and CA Harvest SCM if using Subversion to sync
I am trying to harvest all inclusion directives from a PHP file using a
I'm using Web-Harvest to extract some data from a site. Site gets a POST
I am using Web-Harvest to do some web page scraping. I have a table
I'm in a team of 15 developers currently using Allfusion Harvest. We're not happy

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.