Skip Navigation

[Closed] Missing Javascript when loading function cred_form()

This support ticket is created 2 years, 11 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 Nigel 2 years, 11 months ago.

Author
Posts
#2280073
missing-javascript.JPG

Tell us what you are trying to do?

I'm trying to load cred_form() via Ajax with dynamic post_ids. I've seen a few threads with people having issues displaying the forms correctly using the function.

Has this been fixed (in one of the threads it refers to 2.6.10) and I'm just not able to load this via Ajax or could there still an issue? I'm running the most up to date version of Forms (Version 2.6.12)

Is there any documentation that you are following?

https://toolset.com/errata/forms-not-working-correctly-when-rendering-them-using-the-cred_form-php-function/
https://toolset.com/forums/topic/cred-form-javascript-missing-when-called-via-php-cred_form-function/

-------

It is Ajax that's causing the issue, if I preload a form (using the function) then use Ajax to overwrite it with another form. When the new form is generated from Ajax, almost everything works apart from categories & tags. I can also save successfully which will fix the form. Anything you can suggest?

#2280433

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I'm afraid what you are aiming for isn't supported.

The linked ticket and erratum refer to loading a form in a PHP template using the cred_form method and finding that the form didn't function as expected, notably that submitting the form via ajax didn't work.

If I understand you correctly, you are aiming to add the form to the page via ajax, which is a very different thing. Forms enqueue and run JavaScript files that initialise the form and are required for certain functionality; loading the forms via ajax means those scripts will be missing. Only the most simple forms that didn't require initialising would work when added to the page this way.

There's no API for setting up a form in this way, so I don't have a solution for you.

I suggest you include the form in the template (either the PHP template or a dynamic template made with Toolset) and then manipulate it as required if you only need it to appear based on some user action.

The topic ‘[Closed] Missing Javascript when loading function cred_form()’ is closed to new replies.