Skip Navigation

[Resolved] call custom javascript after ajax form completed

This support ticket is created 5 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1296983

Dear Sir/Madam,

As the CRED From submission can be called using ajax, may I know whether I can know when the ajax submission completed and then I can do some custom javascript?

Best regards,

Kelvin.

#1297031

Hi, no there isn't a JavaScript API for Forms, so there is no easy way to "hook into" the AJAX submission event. If you want to trigger some PHP, you could use the cred_save_data or cred_submit_complete hooks: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Or if you want to display a specific message, you could disable the AJAX update and use cred_success_redirect to redirect to some URL with a special URL parameter.