• Hi there,

    I am looking for some advice or plugin suggestions in order to accomplish the following:

    I would like the user to select an “item” or “input” from a dropdown of say 5 options, then without reloading the page, show them certain data. I suppose you could call it an accordion except it uses a drop down selector and is not necessarily contained in a box.

    This is probably an easy one for most experts here. Thank you in advance.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    How much data is involved with all the options? If all the related data for all options isn’t too extensive, you could contain it all on the one page, but hide it all with CSS. Add a JavaScript onchange listener to the dropdown field. When it fires, display the data that’s related to the selection. Very much like an accordion script, you’re just listening for a slightly different event. There are some basic examples in this SO topic.

    If the data involved is fairly extensive, it may be desirable to fetch the appropriate data from the server and insert it into a DOM container that’s already in place for this very purpose. Getting data from the server involves either a REST API or Ajax request. A basic example is in our Plugin Handbook.

Viewing 1 replies (of 1 total)

The topic ‘How to display data based on a users input or selection’ is closed to new replies.