Support Forums

Hey there, it looks like you've been redirected from designsandcode.com - as you can see we have a new home - read more

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro query string not updated

Viewing 8 posts - 1 through 8 (of 8 total)
  • Hartley Stone
    #84541

    HI,

    I have multiple post meta filters with in the same search form.
    There are two which I am having some issues with:
    1-Region
    2 -Country
    I have custom fields with the countries for each region and with jQuery I hide and show the right one depending on which region the user selects. Everything works fine until after selecting one region and one country the user selects directly a different region. The query string is not reset and it keeps the country which was selected before causing an empty result.

    I will provide you with the url of the page if needed.

    Hope you can help.

    Many thanks

    Trevor Moderator
    #84571

    This is using custom js that you have written? When the user selects a new region, does the js reset the country also?

    Hartley Stone
    #84577

    I am just hiding and showing the option field like so:

    jQuery(document).ready(function($) {

    var
    regions = jQuery(‘.sf-field-post-meta-directory_region’).find(‘.sf-input-select’).val();
    //console.log(regions);
    if(regions !=””){
    if(regions == “Africa”){
    jQuery(‘.sf-field-post-meta-country_africa’).show();
    }
    if(regions == “Asia Pacific”){
    jQuery(‘.sf-field-post-meta-country_asia’).show();
    }
    if(regions == “Central & South America”){
    jQuery(‘.sf-field-post-meta-country_central_south_america’).show();
    }
    if(regions == “Europe”){
    jQuery(‘.sf-field-post-meta-country_europe’).show();
    }
    if(regions == “Middle East”){
    jQuery(‘.sf-field-post-meta-country_middle_east’).show();
    }
    if(regions == “North America”){
    jQuery(‘.sf-field-post-meta-country_north_america’).show();
    }
    if(regions == “Australia & Oceania”){
    jQuery(‘.sf-field-post-meta-country_australia_oceania’).show();
    }
    }

    });

    Trevor Moderator
    #84579

    And that works if the user changes the Region? I mean the filters hide and reveal? Surely there should be an onchange test also? And also setting the others back to blank if the region has changed?

    Hartley Stone
    #85228

    Hi Travor,

    I tried resetting the value to 0 with jQuery, although the page is refreshing and I can’t do a onchange test.

    Do you have any Idea?

    Thanks

    Marco

    Hartley Stone
    #85230
    Trevor Moderator
    #85262

    Sorry, no. It isn’t really my field. I do dabble, and it takes days to do simple things, usually when I stumble upon it. when I do that, I heavily use snippets that I find on StackExchange.

    Hartley Stone
    #85280

    I have fixed it my friend! Thanks for you support anyway!

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘query string not updated’ is closed to new replies.