Is there a way to change a secondary set of options based upon a prior select?

Is there a way to change a secondary set of options based upon a prior select?

rmeetinrmeetin Posts: 100Questions: 24Answers: 1

Let's say that you're building some sort of problem tree. You provide the administrator with a select option:

  • Animals
  • Vegetables
  • Minerals

If he/she selects animals the editor form reveals options related to Animals:

  • hemisphere
  • habitat
  • color
  • endangered

Vegetables:

  • color
  • carbohydrates
  • vitamins
  • child-friendly

Minerals

  • rare
  • precious
  • mallable

Is this possible with DTE? If yes can you point me to an example?

Answers

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    I'm sorry, but I'm not clear how this relates to DataTables? Are you referring to some method to filter the table?

    Colin

  • rmeetinrmeetin Posts: 100Questions: 24Answers: 1
    edited March 2021

    In datatables editor you offer select for choosing items from a list. You want the form to be smart and concise. The user/administrator chooses animals from the select.

    Rather than displaying/offering options relevant to all 3 including vegetables and minerals, once animals is selected it will only display the next select that sisters with animals:

    1. hemisphere
    2. habitat
    3. color
    4. endangered

    This helps keep the form shorter and reduces confusion. This is somewhat similar to choosing countries, then drawing in from the regions relevant to the selected country.

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    You could use dependent for that, something like this example here. Or possibly a change event as discussed in this thread - see Allan's answer towards the end,

    Colin

This discussion has been closed.