Support

Account

Home Forums General Issues Dynamically populate a field from another field

Solving

Dynamically populate a field from another field

  • Hopefully a simple request –
    I have a need to allow a user to:
    1 – select an item from a dropdown list, and
    2 – have another field populated with information based on the original selection.

    For example – it the user chooses “ABC” from the first drop down, I need the second field to reflect “Aaron Bob Charlie”

    Any assistance will be greatly appreciated.

  • Where is “Aaron Bob Charlie” coming from?

  • Hi John – thanks for the swift response.

    My intent is to create a separate field where that data would be entered (as it may change frequently and it needs to be referenced for other purposes).

    JM

  • I’m still not understanding what it is you’re trying to do. Can you supply more detail.

  • Hi John – I apologize for the delay in responding to you.

    My intent is as follows:

    Dropdown Field One –
    Will contain acronyms such as
    “One”
    “Two”
    “Three”
    etc.

    Dropdown Field Two –
    Will contain matching full descriptions such as
    “Item One”
    “Item Two”
    “Item Three”
    etc.

    Each of the items in Field One and Field Two will correlate one-on-one directly to the other. I am choosing two separate fields because the data in each field will have specific uses in forms we generate. (for example, in one part we will populate only the acronym, and in another the full descriptions)

    What I am attempting to find is a solution where if the User chooses an Item from Dropdown Field One and it will automatically populate Field Two.

    Is this more helpful?

    JM

  • You need to use JavaScript and AJAX to populate the second field. This example populates a select field based on another select field. It’s probably not exactly what you are looking for but it show the basics. https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/dynamic-select-example

  • Thanks John –

    I really appreciate your attempt to help here. Regrettably this is SO far above my head that although I’m sure it’s helpful to most, it is all foreign to me. Guess we’ll look at other avenues/products.

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

You must be logged in to reply to this topic.