I need to build a single-step form that asks a question then displays further fields based on the answer given to the question.
Does anyone know of anything?
I need to build a single-step form that asks a question then displays further fields based on the answer given to the question.
Does anyone know of anything?
Ha! UIkit3 forms can do this!
Just occurred to me, to add an accordion to the UIkit3 form, when clicked it opens (obviously), then in the bit that opens you can add more form fields, which then work just like any other field in the form.
Nice one @Lucas :-)
That’s a good solution.
It is, ain’t it!
I know that the grid stacks works in the forms stack, but never though to try the other stacks, and most work. So that opens up a whole new world of options for forms! On this particular form (for an airport shuttle service) it’s also meant I can now reduce the main form down to just the minimum, and have all the additional fields, like baggage options, return transfer options, etc. in accordions. makes the form far neater and easier to manage for the end user.
It’s gone from this…
To this…
Thanks Steve :)
Actually never though about adding an accordion to the form, but yep it works as expected.
@steveb Yep, UiKit really is a gem. :) To be fair though and to add to your initial question I can tell you that Yabdabs “FormLoom 4” plugin can exactly do what you asked for: displaying different form fields based on the input/selection of a previous form field. So you don’t have to use accordions (whose titles are always visible).