Skip Navigation

[Resolved] Workaround suggestion for repeatable fields

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to edit repeatable group in the same form as the parent post.

Solution:
A Toolset form is always tied to one post of one custom post type. As RFG fields are a different custom post type, they have to be entered in a different form, a form tied to the RFG custom post type.
So, we can't actually have one form for updating/creating the parent post and the RFG items. We'll need to have 2 forms. And we can't create and RFG item if the parent post is not already created.

If I did understand your use case, I'll suggest the following workflow for an example of a custom post type "Books" holding an RFG "Books comments":
- Create a form for adding Books. Configure the form to redirect to the book page after submission. Check this screenshot http://prntscr.com/tfhr6k
- Create a content template assigned to books, this template will display each book.
- Put inside this template an edit form for the book if you want.
- Create a for adding "Books Comments".
- Put this form inside the "Book" content template. If you visit a book in the frontend, you will see the form and you will be able to add RFG items(book comments) to the book. This form should be configured to "Keep displaying this form" after the user submits it.
- To display the RFG items, create a view for it, and put it in the content template. To make sure a new RFG will be displayed, the form for RFG should not use AJAX.
- Now if you want to edit RFG items, create and edit form for the RFG and put it in the loop of the view.

Relevant Documentation:

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by evaM 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1697735

Tell us what you are trying to do?
I created a form and additional repeating fields groups (RFG)
I combined them on one page

I want the user to see what was filled in the repeating fields
is it possible to implement views of the RFGs to let the user see the input asap?
and: is there a way to edit this input again from the same page - using/implementing what?

Is there any documentation that you are following?
https://toolset.com/forums/topic/does-front-end-forms-for-repeatable-field-groups-work/

Is there a similar example that we can see?
not now

What is the link to your site?
schpinn.at but hidden under a maintenance page

#1702587

Hello and thank you for contacting the Toolset support.

Before answering your questions, it is worth to mention, that an RFG is basically a hidden custom post with a hidden relationship to the parent post. To display RFG, we will have to use a view that displays this RFG, with a query filter on the parent post.

is it possible to implement views of the RFGs to let the user see the input asap?
Yes, it is possible. Let's say we use a content template to display the parent post, inside of it we can put a view that will display the RFG. The view will be filtered by the relationship that represents this RGC, based on the parent post where it is displayed.

is there a way to edit this input again from the same page - using/implementing what?
Yes. Create an edit form for the RFG post, and put that edit form inside of the loop. When the page is generated, each form will be tied to its own post inside the loop.

I hope this answers your questions. Let me know if you have any doubts.

#1702705

Dear Jamal,

thank you so much for your fast reply,
I think my question was misleading

You are one step forward, and i am one step back

I publish a form on a page
and I also publish on the same page with the "normal " form the RFGs...

so that the user can fill out both

is there a way to publish also the filled out RFGs using Views within the same page as the forms are shown?

and is there a way to edit the inputs in the RFG-Form directly in the page where the forms ( "normal ones and RFGs )are shown at once ( not the result as a post genreated from the custom input)

sorry for asking again...
best regards and thank you for your patience,
greets, Eva

#1703059

Hello Eva, it is all right, feel free to ask as many questions as you need 🙂

Let's first agree on how Toolset forms work. A form is always tied to one post of one custom post type. As RFG fields are a different custom post type, they have to be entered in a different form, a form tied to the RFG custom post type.
So, we can't actually have one form for updating/creating the parent post and the RFG items. We'll need to have 2 forms. And we can't create and RFG item if the parent post is not already created.

If I did understand your use case, I'll suggest the following workflow for an example of a custom post type "Books" holding an RFG "Books comments":
- Create a form for adding Books. Configure the form to redirect to the book page after submission. Check this screenshot hidden link
- Create a content template assigned to books, this template will display each book.
- Put inside this template an edit form for the book if you want.
- Create a for adding "Books Comments".
- Put this form inside the "Book" content template. If you visit a book in the frontend, you will see the form and you will be able to add RFG items(book comments) to the book. This form should be configured to "Keep displaying this form" after the user submits it.
- To display the RFG items, create a view for it, and put it in the content template. To make sure a new RFG will be displayed, the form for RFG should not use AJAX.
- Now if you want to edit RFG items, create and edit form for the RFG and put it in the loop of the view.

Does it make sense? Let me know if you have any questions.

#1706209

Thank you so much for the precise hints and explanations! I will check this out! My issue is resolved now. Thank you!