Skip Navigation

[Resolved] What is the best approach in adding a "I confirm …" checkbox to a CRUD form?

This support ticket is created 5 years, 1 month 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 3 replies, has 2 voices.

Last updated by Simon Logan 5 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1401589

I'm looking to add a confirmation checkbox to the add and update forms on this site, along the lines of "I confirm that the details I am submitting are accurate and am happy for them to be shared with xyz". The user has to check this box in order to be able to submit the form.

I don't need this value stored as such, so don't think it would be a custom field (otherwise I presume the value stored when the ADD would then be retrieved when they EDIT and those should really be two separate confirmations) so would i just need to add a checkbox into the form manually then add some scripting to prevent the form being submitted unless it's checked?

#1401679

Shane
Supporter

Languages: English (English )

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

Hi Simon,

You can just add a generic field to your form and just set it to it to required and ensure the field type is a checkbox.
Have a look at the link below.
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

Thanks,
Shane

#1402895

My issue is resolved now. Thank you!

#1405509

Sorry, only just noticed that this doesn't seem to quite work in that when I set it as required even when I check the box the form won't submit as it says this field is required? Have I missed something? My code is:

[cred_generic_field type='checkbox' field='gdpr-confirmation']
{
"required":0,
"default":"",
"label":"I confirm I am happy for the details provided above to be shared with all broker members of the site."
}
[/cred_generic_field]