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?
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?
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.