Skip Navigation

[Closed] Checkboxes required

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.

This topic contains 3 replies, has 2 voices.

Last updated by Adriano 7 years ago.

Assigned support staff: Adriano.

Author
Posts
#244035

Hello,
how can I make the field with checkboxes required?
Best regards,
Michael

#244076

The checkboxes is one of Types fields you can not set as required. If you need to make this required in CRED, I would recommend you to use CRED API to achieve that: https://toolset.com/documentation/user-guides/cred-api/

The cred_form_validate hook should do that.

#244080

Why only for this type it is not possible to set up the required field? I've chosen Types to could set up the forms without coding, I have no idea how to use CRED API and hooks.

#244282

That's because the logic is very hard for this kind of field, so we moved this as feature request to a future release.

Unfortunately, for checkboxes, you must use some PHP code. Using the hook I provided for you, you must replace $fields['my_field']['value'] with the name of your checkboxes field.

Please let me know if you are satisfied with my answer and if I can help you with any other related question.

The topic ‘[Closed] Checkboxes required’ is closed to new replies.