Dynamic form fields

3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 6, 2018   (RSS)

Hi All,

I’d like to create dynamic sets of fields in a front end form which allows a group administrator to list as many members of their group as needed, and on form submission, enter that information into the group’s user record.

My current (but not very elegant) approach is to create a dozen sets of fields in a user record (Ideally I'd like to use a dynamic scheme on the back end too), like:
member_name_1
member_description_1
member_name_2
member_description_2
member_name_3
member_description_3
member_name_4
member_description_4
etc.

I’m then allowing the group admin to populate these fields with a front end form. The form uses an if statement which only shows these fields if the admin has checked a box on their membership application indicating that there are multiple members in the group.

I’ve seen a number of scripts that use jquery Ajax to add forms fields dynamically and create arrays to add data to a database, like the one at: https://www.youtube.com/watch?v=kBAPbCDGCuY but I don’t have a clue how I’d implement the concept in CMSB to insert the data into an existing account record, update the data by another front end form, and ultimately display the data as a search result, etc.

Anyone done something like this before?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Oh, I'm sure that there will be questions.

One of the fields will be an image, so I'll probably need to go with the more complex route

I'll tackle this over the next week or so.

Thanks for the head start

Jerry Kornbluth

.

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php