Skip Navigation

[Resolved] Shortcode in CRED form not showing on AJAX submit

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
#911342
Screen Shot 2018-06-09 at 6.28.32 AM.png
Screen Shot 2018-06-09 at 6.29.00 AM.png

Hi,

I have a CRED form that has my own (custom) shortcode included to display some content.

The cred form including my shortcodes displays no problem on initial page load. However after I submit using AJAX, the form is regenerated, but does now displays my shortcodes as text. (The CRED shortcodes display normally without any problem). SCreenshots attached.

I tried adding my shortcodes to "3rd party shortcodes" in settings

#911400

This is eventually due to the AJAX call, and your ShortCode is not re-firing on that call.

For example, in Toolset Views if you update a search by AJAX you can re-hook custom JS code to certain events such as when the results are updated by AJAX.

Toolset Forms has no such hooks as public API.

But then, I am as well not sure what code you use, since when I use a Dummy ShortCode of my own, I have no issues using it, before or after AJAX submit of the Post Form I created.

Eventually this has as well to do with your Custom ShortCode.

I mean, the ShortCode cannot really break as the Form does not reload the page, it just cleans the fields and leaves it ready for a new post.

I guess the Custom ShortCode is complex you use and subject to custom code, but I could still have a look to see if I can spot what's breaking it's output in an AJAX form