Conditional logic: Country >state > city

Support MB Conditional Logic Conditional logic: Country >state > city

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39774
    BBBB
    Participant

    I try to accomplish conditional logic, where user
    1) selects Country
    2) based on selected Country, see's list of Province / State = (to select/ autofill drop-down)
    3) based on selected Province / State, see's list of cities = (to select/ autofill drop-down)

    Should I first create.
    1) DB with all countries + States ?
    2) DB with States + Cities
    OR
    3) "big" DB table with all Countries + States + Cities

    Should I create 1 (very large) Form,
    where the "State" selection is (in)visible based on conditional logic?
    where the "City" selection is (in)visible based on conditional logic?
    i.e.
    Selection field 1 = Country
    Then Quantity of Selection field 2 (state) to create = qty of Countries (in the world)
    Then Quantity of Selection field 3 (city) to create = qty of states (in the world)
    Seems like a lot of work.. must be a better way.

    Probably there already an example...
    Is there a (video) link to a step-by-step to accomplish this easiest way?

    #39823
    PeterPeter
    Moderator

    Hello,

    I think using MB Conditional Logic might not a good idea in this case because there are too many logics that should be created based on the number of countries, and states. It could be used with some simple select options on your site. I recommend using a third-party plugin or contacting an expert developer to help you to create a dynamic select field with custom code.

    Read more on the documentation https://docs.metabox.io/extensions/meta-box-conditional-logic

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.