Problem:
Can I disable or hide the Submit button in a CRED form by conditions?
Solution:
Yes, you use CRED Conditional Fields.
Let me put a code example below with 2 fields.
If none is filled, you cannot submit the form and a message will tell you what is wrong.
If at least one field is filled, you may submit the form.
[cred_show_group if="($(first-field) eq '' ) AND ($(second-field) eq '' )" mode='fade-slide'] You need to fill at least... xy fileds... to submit the form [/cred_show_group]
[cred_show_group if="($(first-field) ne '' ) OR ($(second-field) ne '' )" mode='fade-slide'] [cred_field field='form_submit' value='Submit' urlparam='' class='btn btn-primary btn-lg' output='bootstrap'] [/cred_show_group]
With this, if no field is filled, the Form cannot be submitted and a message is displayed.
If at least one field is filled, you can submit the form and the message disappears.
And, the best is, this all happens before the user even needs to submit the form.
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/
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 |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
Este tema contiene 2 respuestas, tiene 2 mensajes.
Última actualización por hace 6 años, 10 meses.
Asistido por: Beda.