Skip Navigation

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

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 hace 6 años, 6 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Etiquetado: 

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Pat hace 6 años, 6 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#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