Passer la navigation

[Résolu] CRED function before save

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 support ticket is created Il y a 3 years, 3 months. 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.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par andreaV-4 Il y a 3 years, 3 months.

Assisté par: Christopher Amirian.

Auteur
Publications
#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

Les langues: Anglais (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!