Skip Navigation

[Resolved] Conditional display of the submit button in a CRED user form

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

Problem: I would like to hide the "submit" button in a CRED form using a conditional that tests whether or not other fields are filled in.

Solution: Use the CRED conditional group feature in the Generic Fields button to set up front-end conditional display in a CRED form.

Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/
https://toolset.com/documentation/user-guides/cred-conditional-display-engine/

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

Our next available supporter will start replying to tickets in about 1.89 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Pat 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#902024

Pat

Hello,

I'm working on a Cred user form and would like to display the validation button only if all needed fields are filled. This is another way of validating inputs but that could be of interest in some cases.

My question is : when I'm in the Cred user form, I'm trying to place a condition on the validation button :
[cred_field field='form_submit' value='VALIDER' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']

So, I try to use the Toolset shortcode builder but I'm not able to retrieve any user field. Is there a way to make this happen or do we need to built manually the shortcode?

Regards
Pat

#902141
conditional-group.png
user-fields.png

Hi Pat, it sounds like you want to use a conditional to show or hide the submit button in a CRED User form depending on whether other CRED fields are filled in. Is that correct? If so, then you must use a CRED conditional group instead of the usual conditional output button. Place your cursor in the form editor and click "Add generic fields" and then "Conditional Group". From there, you should be able to select User custom fields in the conditional group editor panel. See the attached screenshots.

#902303

Pat

Hi Christian,

Sounds good, thanks.
A last point, I need to insert a conditional on a date (ie : this field should not be empty). Could you indicate how I can do this?

Regards
Pat

#902439

Sure Pat, you can use this template to test if a date field is set:

[cred_show_group if="($(datefield) ne  '' )"  mode='fade-slide']
datefield is set
[/cred_show_group]
#904203

Pat

Hi Christian,

Perfect
Many thanks
Pat