Skip Navigation

[Resolved] conditionnal output post form

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

Problem:

The issue here is that the user wanted to add a conditional group to their custom form.

Solution:

To setup a conditional group for your form I would recommend taking a look at our documentation below.
https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/

This support ticket is created 5 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.

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)

Tagged: 

This topic contains 17 replies, has 2 voices.

Last updated by olivierF 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1328183

Hi,

I created a user form with generic fields. And I would like to create a publication form with a conditional display according to the generic fields (checkbox in my case) encoded by the registered user.
Thanks a lot.

Olivier

#1328193

Shane
Supporter

Languages: English (English )

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

Screenshot 2019-08-30 at 9.23.44 AM.png

Hi Olivier,

So this conditional group will be used to hide the other fields ?

All you need to do is add the conditional group element to your form and then set the field that you want the conditional to hide/show your data based on. See Screenshot

Please let me know if this helps.

Thanks,
Shane

#1328215

Hi Shane
I only have access to the fields of the current form but not to the user's field. I need to recover the user field.

#1328253

Shane
Supporter

Languages: English (English )

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

Hi Olivier,

I'm not quite sure I follow.

The fields that you want to hide in the conditionals on the user form are they not user custom fields ?

Provide a little more context for me please.

Thanks,
Shane

#1328277

it is not a condition in a user form but in a publication form.
The condition should display something different depending on the user who is logged on.
Thanks
Olivier

#1329397

Hi Shane,
Do you have a solution to my problem ?
Thanks a lot

#1329419

Shane
Supporter

Languages: English (English )

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

Hi Olivier,

I believe I understand now. So the conditional is dependent on that the value of the custom field is on that current user who is accessing the form.

This is possible but you will need to edit your form in the expert mode. However just confirm this and i'll draft up the required shortcode to help you out.

Thanks,
Shane

#1329437

Hi Shane,
Yes thats exactly that. I am in expert mode ...

#1329477

Shane
Supporter

Languages: English (English )

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

Hi Olivier,

You can do it like this.


[wpv-conditional if="( '[types usermeta="myfield"][/types]' eq 'some value' )"]

CRED FIELD GOES HERE

[/wpv-conditional]

So what you need to do is to add this to your form, then replace [types usermeta="myfield"][/types] with the field that gives your field data.

Please let me know if this helps.
Thanks,
Shane

#1329619

Hi Shane,

Unfortunately, it does not work.
When I try to directly display the user field outside of a condition it does not work either.
It looks like he can not find anything.

Thanks,
Olivier

#1329697

Shane
Supporter

Languages: English (English )

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

Hi Olivier,

Would you mind allowing me to have access to the site to check on this for you ?

Thanks,
Shane

#1329699

Shane
Supporter

Languages: English (English )

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

Private fields.

Also let me know what page the form is on.

#1330613

Shane
Supporter

Languages: English (English )

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

Hi Olivier,

I tried logging in with the credentials you provided but they don't seem to work.

Could you check on them and let me know if they work for you ?

Thanks,
Shane

#1330621

i edit the private message with the good mdp.
Thanks

#1330943

Shane
Supporter

Languages: English (English )

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

Hi Olivier,

The credentials still don't work.

Could you send me a screenshot of what exactly you added to the form ?

I suspect that you may have just copied this directly to the form
[types usermeta="myfield"][/types]

If so then you need to replace "myfield" with the slug of the field you want to retrieve from the user. ALso please verify that the credentials work for you.

Thanks,
Shane