Support

Account

Home Forums Front-end Issues Creating a chained question and answers form

Helping

Creating a chained question and answers form

  • Hi all, looking for an idea here.. Basically what I want to do is create a form with questions and answers. With the next question to be shown dependant on the answer to the previous. So for example something similar to:

    Question: Is your car broken a) yes b) no

    If they selected a) next question is: Is the problem with a) the engine or b) gearbox?

    These would then be chained further to narrow down the problem with either the engine or gearbox.

    These questions will all be linked and maybe 4 or 5 deep with different directions. Some questions may have 3 possible answers. I thought about using acf_form() and field groups a little similar to this but I’m thinking there would be a lot of logic looking at each answer and loading a different group so it might get too complicated.

    Is there an easier way? Push comes to shove I could just create a page for each questions and link the answers to the relavant answer page. But I’d like to do something a little more elegent!

    Cheers

  • I’m not sure if I fully grasp what you’re trying to accomplish, so I could be way off here… but, if it’s a matter of drilling down deeper and deeper, I could envision using a custom hierarchical taxonomy to do something like this. You select the parent term and it displays the possible child options, over and over.

    Something like this:
    Car Trouble
    – Engine
    — Possible Engine Issue 1
    — Possible Engine Issue 2
    – Gear Box

    …and so on.

    Again, maybe that’s a stupid idea for your use case. Regardless, by using ACF fields on the actual terms themselves, you could specify a “question” field that is associated with each term and displayed to the user.

    So for example, if the user chose “the engine”, on the next screen they would see the question associated with that term. Like “Which of the following symptoms is your engine experiencing?”, then the child terms of “Engine” are displayed.

    In any case, good luck with your project!

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.