Skip Navigation

[Resolved] CRED conditional group vs Types conditions

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

Problem:

The issue here is that the customer wanted to know the difference between types conditional and CRED conditionals.

Solution:
The Post Fields conditional for types was meant for hiding fields on the backend and for this it works well but since the field information is called through the use of shortcodes with CRED then the field conditionals will be carried over as well.

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by linaS 7 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#561109

I'm building the complex form with CRED for some custom type with lots of fields.

First of all, I've added conditions to some fields at Post Field Group editor. It applied to this post type editor at admin.

Then I've created CRED form (auto-generated), and saw that the same conditions are working already on the form. But labels of the corresponding fields weren't hidden, only field controls. So it looks weird: there are labels without inputs, and if a condition is met, an input is sliding out.

So I searched and found there are conditional groups in CRED forms. I've added such groups (with the same conditions) to the form, and now fields are hiding with labels. But the catch is that clearly, both condition logics are working at once, so that when a field is being hidden, first I see input sliding out, then label. And when a field is being shown, first I see a label, then input jumps out.

Is there any way to fix this except simply getting rid of conditions at Porst Field Group?

[cred_show_group if="($(changed-last-name) eq  'yes' )"  mode='fade-slide']
	<div class="form-group">
		<label>Previous last name</label>
		[cred_field field='previous-last-name-en' post='application' value='' urlparam='' class='form-control' output='bootstrap']
	</div>
[/cred_show_group]
#561294

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lina,

Thank you for contacting our support forum.

The Post Fields conditional for types was meant for hiding fields on the backend and for this it works well but since the field information is called through the use of shortcodes with CRED then the field conditionals will be carried over as well.

What you can do is to just wrap the CRED conditional around the Label as a workaround for this.

Thanks,
Shane

#561352

ok, I see