Forums Forums Search & Filter Pro Hide a field when i choose an option

Viewing 3 posts - 1 through 3 (of 3 total)
  • Trevor
    #51699

    Hi

    I am not sure why you are doing it this way?

    Is this search only one post type, and if so, what is that posts type, what taxonomies (including category and tags) and what meta fields does the CPT have?

    Anonymous
    #51761

    its a post, is a filter for a real estate, in the same form i have

    1 – a searchfield
    2 – a sort field
    4 – a meta field (select) with two options (‘rent’, ‘sale’)
    5 – a meta field (select) with all categories (like 9)
    6 – a meta field (select) with the states of mexico (2 options at the moment: nuevo león and coahuila)
    7 – a meta field (checkbox) with the cities of nuevo león state (like 31 options)
    8 – a meta field (checkbox) with the cities of coahuila state (like 20 options)

    9 – a meta field (number) with the range of prices
    10 – a meta field (number) with the range of area

    I would like to accomplish, that when someone select “nuevo leon” only the meta field of the cities of “Nuevo Leon” show, and the meta field of Coahuila hide, and viceversa (its like a “next step” state > city), i’m trying to do this with jquery “if and else or switch case”, but only do that the first time i select one of these.

    thanks for the reply!

    Trevor
    #51791

    Why not have all the cities (7 & 8) in one meta field? If you have auto count enabled and hide empty values, as soon as a state is selected, the cities from the other state disappear.

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