[Resolved] How to set up front-end entering of a CPT that has a group of repeating fields
This support ticket is created 4 years, 8 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Tell us what you are trying to do?
How to set up front-end entering of a CPT that also has a group of repeating fields....
Here's what I tried:
I have created a CPT( Jobs ) it has many fields and it also has one group of repeating fields (for rooms/locations).
then I created a post form for jobs and a post form for rooms. but I'm lost right now on how to get where I want to go.
I don't know if this is the correct way to do it for what I'm trying to do or not?
Basically what I want to end up with is.....
A way to be able to let our users login( I haven't created the user roles yet) and create a new job and enter data including data for an undetermined number of rooms(hence the repeating fields group). I just can't figure out how to do this. I tried following several different documentation on this and also did a search and tried to follow what i found there as well. But I'm confused.
What would be the step-by-step process for doing this? Starting from the very, very beginning. Such as 1. First create the CPT with repeating fields this way Or should I not have the repeating fileds in the CPT?.
THEN 2. Do this ect... I'm thinking maybe the order that I'm doing things in might be a problem? I don't know.
I created a post form for the "job" CPT and a post form for "rooms" but I can't seem to figure out how to get the repeating fields to work with the job form.
I am willing to start over if I'm totally out in left field lol!
Eventually I want the jobs to be tied to the user that entered them... so that when that user logs in they can ONLY see their jobs.
What is the link to your site? hidden link
Here is admin access: moldtestco / rUwithme?
Thanks in advance for any guidance you can provide.
Laura
If I get this correctly, you want to Create A Job, but i'm assuming the Rooms is your repeatable field group.
So first as you already know the repeatable field groups for the frontend is created as a form. So the user will need to constantly resubmit the form is they want to add more rooms to the same job.
What you can do is to redirect the user from the Jobs form to the Rooms form after they have submitted their Jobs form. On the Rooms form you can just let the form keep displaying itself whenever the user submits it, this way the user can continuously submit as many rooms as they would like.
What I see so far and based on your requirements this is the way to do it. Its just that on the frontend its not as intuitive to create the repeatable field groups like how it is on the backend.
Ok... I think I get it.... just to make sure can you confirm that the following process is correct?:
1. I created a CPT called "jobs" in theis CPT I have a repeating fields group.
2. In order to allow users to enter their data into this CPT from the front-end I need to use Post Forms.
I would need to create two separate forms 1) for the regular (non-repeating) fields and 2) for the repeating fields group.
How does the repeating rooms know which "job" CPT it belongs too?
Well... I tried setting it up like I described above, but the form I created for just the non-repeating fields automatically added the repeating fields in it and will not let me remove them? If I can send you admin login.....would you kindly login and "see" what I might be doing wrong? this is a dev site so it's ok to play around here.
Thank you,
Laura
as you can see in the screenshots when i try to create just the repeatable fields group form it adds all the other firlds atomatically and I'm not able to delete them.
Hi Shane - Thank YOU!! that works! I have a question about the file upload fields....
We do not want the user to be able to pick images from the WP media library. We want them to ONLY be able to upload new image file. Is there a way to make that happen?
thanks!