Skip Navigation

[Resolved] Remove the parent post select on CRED form

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

Problem:
How can I remove the Parent Post Selector on a CRED form that creates Child Posts?

Solution:
You can either remove the field from your CRED form, hide it with CSS (wrap in a

) or use a custom CRED validation API code to check the parent on submission, but that would be definite overkill:
https://toolset.com/documentation/user-guides/cred-api/#cfv

The simplest and safest it, remove the shortcode from the form. As long you use this approach to create your Child posts with CRED, the parent will stil be set:
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

This support ticket is created 8 years, 2 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
- - 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 2 replies, has 2 voices.

Last updated by williamM-3 8 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#418846
dropdown-belongs-to.jpg

I have a CRED that creates an inspection. The inspection is a child of its parent.

I believe when I initially created the CRED I used the "Auto Generate Form" feature.

So, part of the form has :

Belongs to  
[cred_field field="_wpcf_belongs_apron_id" value="[wpv-post-id id='$parent']"]

The issue that I have with that is :

1. It is not a fixed text field. It is displaying a dropdown on the frontend page which shows every one of the Parent posts. That shouldn't be. In the way it exists now a user could change what parent it is assigned to, which of course, would not be good.

2. Can I remove that code entirely and still have this child post know which parent created it?

or, is there a way to make this a fixed field and not a drop down? At least in that way, I could still include it but just hide it on the page with css "display: none".

Screenshot attached.

#419029
Bildschirmfoto 2016-07-24 um 17.00.57.png

1. It is not a fixed text field. It is displaying a drop-down on the front-end page which shows every one of the Parent posts.

This is by design.
You area able to choose the parent from the list of already created parents, just as in the WordPress backend

2. That shouldn't be. In the way it exists now a user could change what parent it is assigned to, which of course, would not be good.

You can either remove the field from your CRED form, hide it with CSS (wrap in a <div hidden>) or use a custom CRED validation API code to check the parent on submission, but that would be definite overkill:
https://toolset.com/documentation/user-guides/cred-api/#cfv

You can also choose how many parent Posts to display in that DropDown:
See Screenshot

3. Yes you can remove it, as long you use this approach to create your Child posts with CRED:
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

#419365

Perfect. Thanks!

I was able to remove it and it seems to still be working properly to associate itself with the parent.

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