Skip Navigation

[Resolved] CRED AJAX form options

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 3 replies, has 3 voices.

Last updated by mykolaK-2 2 years, 10 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#592013

Dear support!

I have a CRED AJAX form in a modal Bootstrap window. This form creates a new custom post, and it does so with AJAX. "After visitors submit this form" option is set to "Keep displaying this form".

What I need to do is display a modal with some text to the user, after user clicks on some button show them the form (the form is within the same modal, hidden initially, and on a button click I remove a 'hidden' class to display a form), and after form is submitted hide it (by adding a class 'hidden' to the form) and display some other text. All this is going to be done with JS.

However, I cannot figure out a couple of configuration options I need to apply to it.

1. After a form it submitted, it shows the following message in a separate pop-up window: "Operation completed successfully". Please see an attached screenshot for reference. How do I disable it?

2. After the form is submitted, it seems to be reloading a modal content erasing all adjustments I've made with JS. How to prevent this? I want form just to submit data and show nothing else to the user (ideally the form would hide itself after data is submitted). If it cannot be prevented, is there any JS callback that is fired after redraw where I can restore those parameters that were set with JS?

3. Are there any JS callbacks that are triggered after a form is submitted successfully? I would like to use those to track that the form has finished its job and can be hidden.

Are those things possible to implement? Please let me know if you need any additional information. Thanks!

Best regards,
Kir

#592362

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Dear Kir

Q1) "Operation completed successfully". Please see an attached screenshot for reference. How do I disable it?
To remove the alert message after ajax submission is already in CRED future release 2.0, our developers are working on it, but there isn't any ETA for it, you can subscribe to our blog to get the updated news:
https://toolset.com/blog/

Q2) After the form is submitted, it seems to be reloading a modal content erasing all adjustments I've made with JS. How to prevent this?
There isn't such a built-in feature within CRED plugin, it is expected result, that it will be reloaded after user submit the CRED form successfully, so it cannot be prevented. we don't currently provide any JavaScript API that publicly exposes front-end events. This is something lots of people have asked for, but our developers have not yet implemented. Any custom implementation developed for this purpose, e.g. listening to all AJAX events and responding accordingly for CRED events, would require custom code, which is outside the scope of the support we provide here in the forum.

Q3) Are there any JS callbacks that are triggered after a form is submitted successfully? I would like to use those to track that the form has finished its job and can be hidden.
Same as above Q2), there isn't such a built-in feature within CRED form, if you agree, we can take it as a feature request.

#592375

Thanks, Luo!

It would be great to see those features implemented one day as they will allow to seamlessly integrate CRED forms into a JavaScript-based code, especially since WP is moving parts of the workflow from PHP to JS - see Project Gutenberg.

#629942

Hi, I have same problem ut I do not understand how off.