Skip Navigation

[Resolved] Conditional Display or hide field?

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 4 voices.

Last updated by Miguel 1 year, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2542101

Tell us what you are trying to do?
I'm entering the value of a field with [wpv-post-id] but I don't want to show that field. The field is a relationship field. So I added a Conditional group so it doesn't show the field but, when I check the cpt, the relationship is not saved.

Is there any documentation that you are following?
https://toolset.com/forums/topic/create-a-post-with-form-on-a-parent-post/

Is there a similar example that we can see?

What is the link to your site?
it's a local site

#2543705

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

The relation item is there in the form to be selected. If you do not show that option then the customer does not know which parent post to select to create the relationship.

Thanks,.

#2544103
5--form-in-the-front-end.png
4--form-in-fechas-template.png
3--button-preinscibirme.png
1--curso-template.png

I forgot to clarify that I was referring to a field on a form.

This form is in a "Fechas" content template.

The customer clicked a button to pre-register on that "Fecha". That's why I don't need to show it in the form, I just need it to register the client on that date when the form is sent.

#2544221

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hola Miguel

The field needs to be included in the form and there isn't a simple way to add a hidden attribute to the form input (it would need JavaScript) so the simplest way to hide the field is to use CSS, setting its height to zero, for example.

#2544321

Ok, perfect.

Is there a way to identify those fields in the visual editor (without activating de Expert mode)?

#2544675

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Expert mode will offer more control over the form HTML so I suggest you should go with expert mode.

#2544885

I went to expert mode, copied the original code, and saved it. It's easier for me to modify the form in the non expert mode.

Then I added a div with the class "hide-fields".

Thank you!!!