Ready to get started?Download WordPress


Query Multiple Taxonomies
DropDown OnChange (2 posts)

  1. Vrefr
    Posted 4 years ago #

    Hi Scribu,

    kind of suggestion for future versions, but if you could give me a hint how to hack widget.php would be also good.

    The issue is that currently to submit selected item in dropdown you have to click the submit button.
    I would like to be able to sumbit selected item in dropdown menu just after selecting it with the help of OnChange= I believe?

    Tried to hack it by myself but was affraid to crash the whole plugin....


  2. Vrefr
    Posted 4 years ago #

    hmmm... as you didn't answer I started to experiment :)
    the decision I don't like, as it may dissapear after the plugin will be updated, was to hack the code of /plugins/query-multiple-taxonomies/widget.php
    Thats what I did:
    In the function private function generate_dropdowns( $taxonomies ) {
    just after .html( 'select', array( 'name' => qmt_get_query_var( $taxonomy ), inserted 'onChange' => 'location.href="?city="+this.form.city.options[this.form.city.selectedIndex].value;'

    I used it only for one concrete dropdown menu for taxonomy called "city", which is also the name of <select> field. Didn't experiment but if you would insert variable (e.g. $taxname = qmt_get_query_var( $taxonomy );)instead of "city" it theoretically should paste universal solution for all other taxonomies you use for dropdown.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic