Skip Navigation

[Resolved] CRED function before save

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

Problem:

I am having an issue with CRED forms.

I want to perform some checks and changes to the submitted data before saving, as well as retrieve data from external fields not on the form.

Solution:

To perform validation on the form field, use the hook:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

To retrieve resources before submitting the form, use the hook:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data

To retrieve resources on the submit action, use the hook:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

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 2 replies, has 2 voices.

Last updated by andreaV-4 1 year, 9 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2553445

Hi,
I have some cred forms and I would like, before saving the data, to be able to perform some checks and changes to the submitted data. What hook should I use and in these cases can I also retrieve data external to my CRED form (example I have external fields not on this form, can I retrieve their data)?
Regards

#2553529

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

If you want to perform validation on the form field the best hook is:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

If you want to retrieve resources before submitting the form the best hook is:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data

And finally if you want to retrieve resources on the submit action use:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Thanks.

#2553531

My issue is resolved now. Thank you!