Skip Navigation

[Resolved] I would like to include a define a credform within an html file.

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to use a Toolset form in an external PHP file.

Solution:
This is not supported by Toolset or WordPress.

This support ticket is created 4 years, 4 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by felixP-3 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1687227

Tell us what you are trying to do?

I would like to define the details of credform within an external file and include that file to the credform interface.

Is there any way to do this?

FOR EXAMPLE: instead of going into the credform interface to change the form, all I would need to do is change the file.

Is there any documentation that you are following?

#1687541

Hello and thank you for contacting the Toolset support.

I do not think this is possible. A Toolset Form needs to be generated in order to be used. There are some hidden data that are being used and that will be generated each time, like nonces. Read more about nonces here https://codex.wordpress.org/WordPress_Nonces

I hope this answers your question, let me know if you have any further questions.

#1687543

Is there any toolset api or functions I can use to generate the credform outside of the toolset interface.

I enter the following in my code to used a credform : [cred-form form="jtfm-government-form" ]

Are there any short codes I could enter to do the same work this short code is doing in generating the form from its definition saved by toolset.

#1687581

The form is generated through a shortcode or a Block if you are using the Blocks editor. You can use the do_shortcode function from WordPress, but you will need to load WordPress and the Toolset plugins to be able to generate the form.
https://developer.wordpress.org/reference/functions/do_shortcode/

Loading WordPress core and plugins in a custom PHP file is not officially supported by WordPress, but you may find what suits you. Check this search results:
hidden link

#1687611

Ok, so if I use the block editor, can I direct the short code to look for the credform definition outside of its normal location?

The way I do it now is using this format : [cred-form form="jtfm-post-type-archive-form"] which fetches the specified cred-form from the database.

I will like to fetch the definition of cred-form ("jtfm-post-type-archive-form") from an EXTERNAL FILE.

Is this possible? Is there a short code method that allows this?

#1689851

From what I understand so far. You would like to have the form on a page /form-here and you would like to submit it to another page /form-submitted-here, right?

This is not possible, the generated form and the form processing are both done on the same page, but you can configure the form to redirect to another page after form submit.

It may be possible to generate the form on a page and handle the submitting on another page, through custom coding, but this is not supported, and it may be complex or have side effects.

If you think I did not understand your question very well, please explains in detailed steps:
- I want to have ...
- I go to...
- I do...
- I want to get ...

#1689913

I want to store the DEFINITION OF MY CRED FORMS in files.

I believe that when a cred form is created, its definition is stored in the database (is this correct?, please let me know otherwise).

If it is stored in the database, can you let me know where?

The bottom line is I would rather edit my credforms in my own editor instead of the toolset credform editor.

Is this possible?

Thanks.

#1690253

I can't tell if it is possible or not. But I can say that it is not supported.

What I can say so far, is that a Toolset form is saved as a hidden custom post type 'cred-form' for post forms and 'cred-user-form' for user forms. As a custom post type, all the data about the form is saved inside the wp_postmeta table. I did a search on my local setup and here what I was able to find for a post form. Some setting sare saved as a serialized array. Check this screenshot hidden link

I suppose, that you will have to create forms with the Toolset editor and track what is saved on the database to understand how you can do it with your own editor.

I hope this helps. I remain at your disposal.

#1690425

My issue is resolved now. Thank you! The information you provided was very helpful.