Dynamic number of form inputs

Dynamic number of form inputs

Comments

  • How do I set a form up so that the number of input fields is dynamic, based on an initial multiselect input box? Users will first select which sections they want to include in a report using a multi-select dropdown box. Then, for each section, they can choose one or more components to be included in that section. So for example if they choose 2 sections, then I need two additional multiselect dropdown boxes, one for each section. If they choose 4 sections, then I need four more multiselect boxes to appear. The number of sections could in theory be infinite, but in reality most reports will have no more than 5 or 6 sections. I could hard code 6 multiselect boxes that appear as needed, but if someone ever chose more than that I would be out of luck. Any ideas? Is there a way to just keep spawning new inputs on a dynamic basis?

  • Hello Ross,

    If we are looking to use the same form and add to dynamically create new input fields, we may need to create a Mixed Data Repeater may be useful for what is being described. Using a mixed data repeater we can dynamically create new input components that can be added to the form. We can customize a select group of elements to be displayed when an event button on the form is clicked on.

    I have attached a sample project as well as added a link to our documentation site that can serve as a guide on setting up a mixed data repeater.

    [url=https://documentation.decisions.com/docs/mixed-type-repeater]https://documentation.decisions.com/docs/mixed-type-repeater[/url]

  • Thanks, that could work. I think I found another way to accept input to avoid that need, which keeps things a bit simpler anyway. Appreciate the help!.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!