Cascading Dropdown to 3 levels

Certified Senior Developer

I am trying to implement 3 level cascading dropdown fields. 'State' dropdown field will have choices based on 'country' selected and 'City' dropdown field will have choices based on 'State' selected. I have created choices for 'States' field using choose() function. But not sure how to create choices for 'City' field. It would be great if anyone can respond to this.

Note: I am using localVariables for all the data. Not querying to DB. This is only for testing purpose.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    How you do this largely depends on where and how you're sourcing your state / city data.  Are you querying them from a DB on demand?  Or all up front?  Or getting them from somewhere else?

    As a personal preference I typically avoid the choose() function as it has particular drawbacks that hinder its use (like the near impossibility of specifying a safe/default condition without bending over backwards).  But I can't tell what to recommend you should try without seeing perhaps some sample code.

    If you could post either your interface code or a representative example here that  would help (please use the "Insert --> Insert Code" tool to create a code box which will retain formatting and indentation, as well as preventing the thread from becoming impossible to read).

Reply
  • 0
    Certified Lead Developer

    How you do this largely depends on where and how you're sourcing your state / city data.  Are you querying them from a DB on demand?  Or all up front?  Or getting them from somewhere else?

    As a personal preference I typically avoid the choose() function as it has particular drawbacks that hinder its use (like the near impossibility of specifying a safe/default condition without bending over backwards).  But I can't tell what to recommend you should try without seeing perhaps some sample code.

    If you could post either your interface code or a representative example here that  would help (please use the "Insert --> Insert Code" tool to create a code box which will retain formatting and indentation, as well as preventing the thread from becoming impossible to read).

Children
No Data