Skip Navigation

[Resolved] repeatable group

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 8 months, 2 weeks ago.

Assisted by: Nigel.

Author
Posts
#2691731

I wanted to know if it is not possible to create a set of fields within Front-end Forms
For example, I want to make a form for the user to fill in details and one of the details is a bank with 3 fields bank name, branch number and account number, and I want him to be able to add another bank [with 3 fields bank name, branch number and account number] as one field that can be set as a recurring field in a form that has other fields,
I read the material I saw about repeating fields and I'm not sure I understood correctly, that there is no such option

#2691748

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

To add instances of groups of fields to a post with a front end form you have to create a separate form, it's not possible to have a single form that both publishes a post and adds groups of fields at the same time. The workflow would be to publish the parent post via a form, redirect to display the post upon submission, and include a link to a second form to add the groups of fields.

This is described here: https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups/

#2691759

I saw this page
Is there no option in expert mode when creating a form to do this??
Thank you
Younes

#2691762

Another question, can the repeating field also repeat the label of the field?
Thank you
Younes

#2691881

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The expert mode just means editing the form markup and the shortcodes used to add fields to the form directly, rather than using the drag and drop editor. It doesn't alter the functionality of forms.

If you wanted to bundle the functionality of creating a post and adding repeat groups of fields to the post within the same form then it would require quite a bit of customisation.

You would need to add additional fields to the form as generic fields (fields that don't actually belong to the post being created, but which you can make use of via the API once the form has been submitted), and then process these fields after the form is submitted (to create a group of repeatable fields, populate the field values, and connect the group to the new post).

That's something which is plausible in the similar context of creating a new post and creating and attaching a child post within the same form, but it becomes much more difficult with repeatable groups of fields, because your UI has to allow adding one group of fields, then another, then another, etc. as determined by the user and how many such groups they want to add.

I'm afraid I don't have an example to show you of how to do that, I'm not aware that anyone has done it before.

I didn't quite understand what you mean with your follow up question about repeating the label.

#2691921

In the follow-up question, I meant that when the user clicks on "Add New" the field label will also appear above the field that is being added
Thanks
Younes

#2692047

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2024-04-11 at 11.39.57.png

Are you talking about fields that can have multiple values, rather than repeatable field groups?

In my screenshot I have a form that includes a field "Arbitrary text" which allows adding multiple values, and I've added several.

You want it to repeat "Arbitrary text" before each instance?

Unfortunately there is very little that can be customised in this output, the format is essentially hard-coded in the plugin output.

The only way would be to manipulate the output once it had already been rendered, by using custom JS to add or modify elements.

#2692441

I realized that it is not possible to create what I want