Search code examples
wordpressformsninja-forms

Adding x amount of fields based off previous field


So I am creating a form where users will be able to X amount of dependents to their data.

For example, if they input that they will be adding 4 dependents, I need to populate 4 new rows to collect that data; dependent_1_first_name, dependent_1_relation, dependent_1_dob and so on.

What is the proper way to handle this situation?


Solution

  • Hey buddy I hope you are having a great day! You can use the Ninja Form repeater to accomplish what you are wanting to do.

    https://ninjaforms.com/blog/ninja-forms-repeater-fields/