Skip Navigation

[Resolved] Would like to redirect to a URl after cred_form_validate

This support ticket is created 6 years, 7 months 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.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 7 months ago.

Author
Posts
#701397

Tell us what you are trying to do?

Would like to redirect form users to a URL if a duplicate record is found matching what they are submitting.

It would also be an effective alternative to generate non form-field specific message above the form (with a clickable link to the duplicate record). The search to the database to confirm the current content of this form as duplicate returns the existing post-id, and thus can be used to create a link in a message.

Please, advice how I could go about this.

Is there any documentation that you are following?

This is a follow-on from https://toolset.com/forums/topic/prevent-duplicate-records-for-custom-types/#post-701119 ..

I was advised to open further tickets to enquire about this.

Is there a similar example that we can see?

No

What is the link to your site?

Not applicable .. I am only seeking advise

#704845

There are 2 ways to redirect to another location after a form is submitted in general.
One is within the CRED Form GUI, you can set to redirect to several different locations.

Another is using the API explained here:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

Practically you can start redirecting at any point, but those hooks offer the last moment to do it in the process of a CRED form submit.

That's where you want to hook in, as by then all data is saved and validated.