Skip Navigation

[Résolu] Submitting information on a post using repeatable forms on the frontend

This support ticket is created Il y a 6 années et 5 mois. 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: Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Mike Il y a 6 années et 5 mois.

Assisté par: Luo Yang.

Auteur
Publications
#920605

I am working on a webapp for canvasing potential voters.

I have a custom post type of "voters" that has a repeatable field group called "Voter Canvas" I have also created a post form called, "Canvas Form"

I want to have the form embedded in the single page template for the "Voter" so that we can record the results of our visit with that voter.

The reason I am using the repeatable field group is that each voter may get multiple visits over time.

However, I cannot get this to work. I have been able to get the form to show on the single page but entering information does not save to the post.

Is what I am trying to do possible?

#920771

Hello,

Yes, it should be possible within Toolset, please check these:
1) You are following our document to setup the Toolset form:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/

2) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

3) Enable PHP debug mode, copy and paste the debug logs here, we need to know if there is any PHP error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
PHP Debugging
To enable PHP debugging in WordPress, edit your wp-config.php file and add the following:
PHP Debugging in WP
ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

4) Deactivate other plugins and switch to wordpress default theme 2017, and test again

5) If the problem still persists, please provide a database dump file (ZIP file) of your website in below "private detail box", I need to duplicate same problem and debug it in my localhost, thanks.

#920980

I may have been a bit unclear.

The link in #1 describes using a selector to choose the parent post, also how to embed a button within the parent post that takes you to another page and autoselects the parent post.

I am looking to embed the form in the parent post. Maybe I'm missing something?

#921056

Please edit your Toolset form, and try these:
1) in section "Content", find and edit the relationship field, setup the attribute "value" as current post ID "[wpv-post-id]", for example:

[cred_field field='@voter-canvas.parent' value="[wpv-post-id]" ... ]

If you can not find the relationship field in the form, please follow above document to setup it:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-with-selectors-for-the-parent-post

2) Display above Toolset form in a single "voters" post, it should be able to preset the parent "voters" post, then test again

More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
value.
Preset value

#921529

Thank you very much! That seems to have done the trick.