Skip Navigation

[Resolved] repeating field entry in cred

This support ticket is created 7 years, 12 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.

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: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 7 years, 12 months ago.

Assisted by: Luo Yang.

Author
Posts
#393672

Hi,

I'm just getting going with Toolset, and I have set up a Meals Custom post type and an Ingredients Child which will allow for multiple ingredients to be added, with ingredient name, ingredient quantity and calories input fields for each ingredient. The set of ingredients will be then added to the Meal.

I want to create a Front end Cred form for members to add meals, with Meal name, description, Ingredients, and some other Meal related post fields.

I built a Meal Cred form with one instance of ingredients fields in it and wondered how to repeat this or add functionality to add more ingredients. I think I can lay out the form to have say 5 Ingredient slots for input by repeating the lines for Ingredient post field inputs an few times? and then it is limited to only that amount of ingredients to add. Is there a way to make this more flexible, so that if a meal has more ingredient lines in it then the user can add more.

I read the post re intermediate Child cred forms but they seem to assume that the Parent has already been created, so I don't think that works for me. Do I perhaps have to create a Meal Cred form then pass them to an Ingredients Child form or am I ok adding the child post fields to the main meal Cred form as above, if so is there a way to request more rows for ingredient inputs as discussed above.

I hope that is clear, but if not, the example you use is House and Rooms, so same question. I want a front end Cred form for users to submit a House with Multiple rooms and to be able to add more rooms if required...

thanks for some advice here..

#394137

Dear iainm,

In your case:
one "Meals" can be connected to multiple "Ingredients" posts,
and one "Ingredients" can be connected to multiple "Meals" posts,
So I suggest you setup many-to-many relationships between post type "Meals" and "Ingredients", see our document:
Creating and Displaying Many-to-Many Post Relationships
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
And setup the custom field "quantity" into the intermediate post type

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.