Skip Navigation

[Resolved] Repeater Fields Groups in CRED working?

This support ticket is created 6 years, 3 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 30 replies, has 2 voices.

Last updated by Ljuba 6 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1069593

Repeater Fields Groups in CRED working or not? Please some tutorials links. If not working, please some idea how to solve the issue.

I created RFG for Booking purpose with fields (dates > entrance and departure, No of Adults, No of Kids and Room Type). I need simple "Add another Room" (mean entire group fields). When rooms are added, main (parent?) form with own additional fields, should to be submitted.

So, "Add another Room" (Group) > How to do it?

#1070013

You want to edit/create Repeating Field Groups Items with Toolset Forms?

If so, please refer to this doc
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/front-end-forms-for-repeatable-field-groups/

Toolset CRED is not anymore existing - this plugin is now Toolset Forms. Just in case you are confused when I mention Toolset Forms and never CRED.

In Toolset Forms you can Create RFG (Repeating Field Groups) by creating a new Post Form and choosing the RFG (it can not be a nested RFG) to create.
The rest is as in other forms, just that it will add a Selector to choose to what (parent) post the new RFG belongs to
You will be able to set title of RFG and it's fields values just as in the backend but only ONE a time / each form

The same is for edit forms, you can edit RFG's the exact same way.

Remember, NESTED RFG will not work.

Note, that the doc above is WRONG and states that you can not create edit forms.
I reported this already.

You can create such forms, but only for NOT nested RFG's.

Also, of course, the edit form needs to be inserted by passing the exact post to edit (as it cannot take it from the Current Page, since the current page is never the RFG)
Hence, when you insert the Edit RFG form, make sure to choose the/a specific RFG (the GUI suggests the RFgs available) to edit.

Please let me know if you need more details

#1070065

Well, yes, I need help, as I already did everything, but it is not as I expect. In my Alojamiento demo front, you can see on 'Reserva ahora' button click, that it will colapse one RFG form (for Habitaciones). I yet didn't inserted it in 'parent form', but I was confused by fact that RFG form don't have 'Add another', instead is just 'Submit' (like any form), what by itself is not the problem, but after form submission, the form row is not repeated, it remain same (so, I can't see functionality of repeat, as well). So, how people will know that they added succesfully booking for first room??? By the way, you can try and after submission, new 'Reservas' post is not created (I guess that it wait for 'parent form', but.... - nothing is clear for me how it works).

Under Forms, you can see that I already created (sort of) two form (parent and child). It is certainly not the problem to merge forms, but as I wrote, by onlyh begin, nothing is as I expect.

#1070067

As I stated, in my extensive previous reply, to the detail, RFG cannot be created for edited in MANY a time but only ONE a time and that is as it is, I cannot change it.

What you can however do, is for example, redirect to the same page or a somewhere else where the sam form allow to create new field.
You can even keep display this form after submit so you can submit indefinite RFG.

The forms work like any other Form of Toolset (POST/USER) and hence have success messages, redirects and al the used to settings.
It's all the exact same as post form just you create/edit RFG

This forms are NOT inserted in any parent form
They are inserted to (when create) any post or page, and when edit, as well any post or page, but you then need to pass the exact RFG to edit

You cannot reorder the fields as in the backend, in Toolset Forms just yet.
We will eventually elaborate on those features in the future.

I have no access to your site or precise links to what form, field and post you refer to.

If you need help online with that, I can setup for example a Dummy Post with RFG and Forms, right there.
For that, I need the details to access the site and allowance to do so.

#1070074

Changing state and opening private replies in case needed.

#1070101

Removing private.

#1070120

Removing private reply once again.

#1070127

From Ljuba, shared on another post:

I actually at the begin assumed that what you wrote at the last reply (how it cannot be repeated) and for such reasons, I ask is it some other solution for that scenario, or I should completely to change concept for those kind of Forms?

Actually, I closed with Nigel other ticket where we discussed about another issue, but essence was similar and I decided per moment to switch this functionality what need (Reservation forms), to Formidable Pro. Reason was as I don't want in real life that those forms create new posts (Nigel just explained me what I can do as alternatives and I switched back to Toolset for form purpose). Now when I'm back to Toolset and repeating feature, I have this (another problem and this new ticket).

So, again, no big deal, if RFG cannot do it and there is no other scenario, I will go again for Formidable Pro solution, except if you don't have idea how to 'repeat the rooms'.

So, do you have idea, or to close the ticket. Simple (sometimes, I know also to be simple).

The solution was shared here:
https://toolset.com/forums/topic/repeater-fields-groups-in-cred-working/#post-1070067

It is:
Create a form that adds RFG, and either keep showing this form so the user can keep submitting RFG or redirect to the same form (for example on another page or just redirect to the same page) so the user can keep submit RFG's

You can however not replicate the same behavior as the backend, where you can drag and drop to re-order those fields.

What you can do, is include the Field toolset-post-sortorder in your Form, and let the user choose a order number (which reflects the order in the RFG list on a post), but for that, you would need to give that user a hint, what the already existing order numbers on the post are.
That, requires Custom code.

You could get all posts (RFG posts) and their items and order numbers and display the highest of them on the form for example.
It however asks for complex custom code.

In the case you have another plugin that does that, it would probably be the best solution if you need it.

#1070131

Thanks. I will see what to do. Issue with Formidable Pro is only slightly more complicated way how to pull out post owners emails (as here is every post different user/email). However, as I have also there developer support, I will give a try.

BTW - regards, the RFG, I don't think how it works as you described, as I did it and there is after message of success, ZERO new posts, what is logical as there is ZERO fields of ordinary fields on form and parent form is actually not yet created (so, can't be either RFG post). From other side, if I use normal form with RFG fields inside, I can't see what is the difference and purpose of RFG (as it is the same). Actually, I can't see absolutely any way how to repeat either ordinary fields (with multiple values - is - room types - as any of such kind of fields is not repeatable), for purpose to create sort of different form.

#1070140

I think there is some confusion here.

Toolset Repeatable Fields work fine in Toolset forms as I show above.

I would like to show you how, if you wan to open a ticket for that purpose, J can either setup a dummy structure for you to import, or even an online test site to show it (provided by us)

#1070145

Great. Please reopen private and you will find already all done (including View), so just form itself remain.

#1070147

Private enabled.

Please add the exact links and steps so I can set up a dummy Form to create new RFG of a certain type.

#1071326

You are not adding reservas with this Form, but Fields, repeatable fields, those get attached to any chosen @grupo-de-habitacion.parent.

It is this Fields group fields that you add with that Toolset Form:
hidden link

Those Fields, they are added to posts (which have to exist) of type Reservas
But there are 0 reserva posts in this install, so how can it be created or even display such posts in the drop down of the form?
hidden link

You would need to create a Reserva post, and only THEN; you can assign a parent to the new RFG.

Does that make sense?
It is the exact same in the backend.

I added a reserva for you which you can now connect when create a new RFG with the Form.
It works fine, it attaches the new RFG to the reserva post

#1071355

Yes, that about parent I wrote before at https://toolset.com/forums/topic/repeater-fields-groups-in-cred-working/#post-1070131.

However, I can't see how it can works fine (also in general, as 'public form'), for next reasons:

1) MORE THAN UNUSUAL FORM

To get 'parent half' of the form, we ALWAYS first need to use sort of 'trick' to force user to create it. That is not so hard, but in 'real world' there is no such kind of the 'on the fly' forms (so, memberships, intake forms, etc, are different from 'short forms'). In this case, I basically first should to 'force' client to submit his personal data (in essence, to 'register him as user') and just after that to let him to choose the rooms. There is no way how people will accept it. Also if we count that this kind of "collapse' design of form let us to 'trick clients' with "more options"/"check availability" or whatever and to use that 'click' like trigger for 'parent form' submission (as well for collapse".

QUESTION (possible solution)

Is it possible to use 'click' on 'Reserva ahora' like trigger for some kind of automatic generation of 'parent form'?

Than, it could to work.

If it is possible, how to do it?

If you can make it, I know rest of solutions (below).

P.S. - Here is important to mention, that by collapse, button should to check title to "Check Availability" ("Comprobar disponibilidad"), like final submission of form.

P.S. Here is also important to pay attention that by such submission of 'first half' of the form ('form initialization'), field in RFG for 'parent form' (here os Reservas') should to be AUTOMATICALLY SET TO CREATED POST!!!)

2) REPEATER MISSING

Fact is that missing 'repeater' of the RFG.

I think that solution could be one View to get this effect. So, we should to rename button from 'Submit' to 'Add another' and create second action of display of the View of generated 'child form' (RFG reservations set). When user is done, he just click on 'initial button' (parent button), for final form submission.

PROBLEM (how to solve 'removal' of wrong submitted RFG???)

So, if you know how to solve above, it could to work.

#1071358

Actually, I think that if you can solve above scenario, Toolset can publish that there is working solution for RFG (it could use also "modal", not just "collapse". So, every time for "Add New" it launch 'modal' for new RFG. AJAX reload' parent form content (add View) and so on.

Yeah, for delete/edit should to be added another (but edit) form instead of View.

Basically, by Ajax refresh by adding new 'edit' subform' - it also don't need collapse or modal.

Yeap, there are also some other 'tricks'.