Ninja Forms - add a field programmatically to a form

Viewed 213

I'm searching for hours to get an answer to this simple question but I'm not able to get any information about this. The ninja form will be used to book a room in a hotel. I have a custom post type "Rooms" that holds the data for the room (acf), eg. single or double room, equipment features, etc. I want to be able to create a bunch of form elements (e.g. a select for single or double room) dynamically out of the data of the different rooms (custom post type fields) and add the dynamically created fields to an existing ninja form.

I can't use placeholder fields in the form and replace the values because the number of different rooms is not always the same. If I add a new room (as a new content page) the form should automatically list that new room without touching the form builder.

Getting the room values is no problem, I just can't find any documentation for adding custom generated fields to an existing form.

Is there a way to accomplish this?

0 Answers
Related