Skip Navigation

[Resolved] Create a Post with form on a parent post

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

Author
Posts
#2537633

Tell us what you are trying to do?
I have the CPT "courses", "editions" and "registrations"
Courses << Editions << Registration

They are related one to many.

A course will have many editions and each edition will have many enrollees.

I create a course. ok

Then I create an edition of a course, ok.

Finally, I want that, through a form, they can register for an edition, thus creating a registration.

I tried to create a form in the registered entry template.

It has all the registration fields, ok.

It has a related field "registrations-editions" that I want to use the edition that I am viewing at that moment and not have to choose from a drop-down.

how can i make it take the value of the edit field directly?

Is there any documentation that you are following?
https://toolset.com/course-lesson/what-are-post-relationships-and-how-they-work/

Is there a similar example that we can see?
I don't know

What is the link to your site?
its a local site

#2538561

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

screenshot-visual-form.png

Hi,

Thank you for contacting us and I'd be happy to assist.

To automatically select the current 'edition' post in the relationship selection field, you can add the "[wpv-post-id]" shortcode to get the current post's ID, in that field's "Field default value".
( example screenshot: screenshot-visual-form.png )

Note: if your form is set to use the expert mode, you can pass the current post's ID through the "value" attribute:


[cred_field field='@property-property-rating.parent' class='form-control' output='bootstrap' select_text='--- not set ---' required='false' value='[wpv-post-id]']

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2539349

It works but it shows that field in the form.
I don't want to display that field.

Should I have to hide it with CSS?

thank you!

#2539417

I couldn't hide the field with CSS but I found a solution:
I added a conditional group and set two related conditions so that they are never met.

My issue is resolved now. Thank you!

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