Skip Navigation

[Resolved] CRED form not ticking checkboxes

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

Problem:
When you insert a CRED Edit Form to a Page and use the post='' attribute of the CRED Edit Form shortcode to specify which post to edit, and the form features any type of checkboxes (including taxonomy checkboxes), these checkboxes will always be displayed as unchecked on the front-end form. This happens no matter what you saved in the backend when editing the post.

Solution:
https://toolset.com/errata/checkboxes-cred-fields-always-unchecked-cred-edit-forms-editing-specific-post/

This support ticket is created 6 years, 10 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 11 replies, has 3 voices.

Last updated by beatR 6 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#612341
eve-event1.png

Hello

checkboxes do not appear ticked in a CRED form. i've made a test setup.
default wordpress theme, all plugins deactivated except toolset. toolset plugins downloaded and fresh installed.

this is the post for testing, editing the last post of a custom type:
hidden link

thanks for looking into it. this is urgent...

Beat

#612369

I see you have 2 test Forms in your install.

When I open up the Test Form (User Form) I am presented with the Creation Wizard, not with the Form.
I deleted that Form, as it's not setup completely anyway, and it may conflict with the slug of the other Test Form

Then I re-saved the Test Form for posts and checked the issue you report.

I observed that the values are very well ported to the Post, when you save them in CRED.
This means, if you add a new checkbox in CRED (check it) and submit, this is correctly saved to the Post, but CRED fails to show this.
The checkbox stays unchecked.
And since the Checkboxes stay unchecked, if you do not re-check them before submit, the values are lost.

It seems these checkboxes are all taxonomies, is this correct?

I am able to replicate this locally, when I insert an Edit CRED form into a PAGE and pass the ID of the Post to be edited.
It does not happen however when I insert the Form directly in the Post to be edited.

Can you confirm this as well?

It also does not happen if you call the CRED Edit form in a Content Template, insert the Edit link with the Views ShortCode [toolset-edit-post-link content_template_slug="your_template"]Your Link Text[/toolset-edit-post-link]

Hence, I will report this to the Developers, to be fixed.
Give that there are workarounds, it might be on a lower priority as other breaking Bugs, but give that we still support this way of editing content, and this used to work just fine, it will be addressed as a BUG.

I will keep you updated here on the process.

Please let me know if I understood the issue properly.

#612446

Hi Beda

thanks for getting back to me quick. I will see if your comments help me to do a workarround in the productive page.

firstable, yes, they are all custom types taxonomies. i'm a bit confused, how else would i show the form for a specific post? you mentioned editing the current post and using in content template.

but it seems to me it should work the way i did it, not just for legacy reasons. that's not how it should be done anymore? i this specific case i need it to perform some logic to select the post and output the form, in a shortcode, like:

return echo [cred_form form=anbieter-bearbeiten\" post=".$anbieterbeitrag->ID."]

how else would i do that? everybody else is outputting the edit form for the current post or in a template?

thanks!

#612639

solved it for the moment by making a view filtering by the desired post via passed parameter. then using the cred shortcode for edit form and "current post"

so, this works 🙂
(but i look forward to post=id working again too)

#612640

i have to reopen. just noticed that by packing it into a view, the user cannot edit his own post that has status "pending review". all posts get this status until admin publishes. but user has to be able to edit.

so unfortunatly no solution yet. do you have a tip? can i include posts with "pending review" in a view?

#613259

In reply to this:
https://toolset.com/forums/topic/cred-form-not-ticking-checkboxes/#post-612446

- Yes, there are other ways to display CRED Edit Forms
- You would follow this Document here:
https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/

This is the suggested way that should be followed whenever possible.

You can still insert a form directly to your post, as you do, but we have no API to do that with PHP.
do_shortcode() may present unexpected results in certain cases.

But I was able to replicate the issue you report, and have created a task for the Developers.

Can you try this approach?
It should also solve the permission issue, as long you do not use Access, which you seem to not have installed.

Otherwise we would then need to handle that in a new ticket, which I may create for you if necessary.

#615072

Hi Beda

Sticking the cred shortcode for the current post into a template and then using this shortcode worked:

[wpv-post-body view_template="anbieter-bearbeiten" id=$postid]

So, this is solved for now (i hope it stays that way :-))

Thanks!

#617025

I reopen this and will update you when the bug is solved.

#625885

Hi,

I have the same issue. Did you solve this bug ?

Thanks

#643335

There is an erratum for it:
https://toolset.com/errata/checkboxes-cred-fields-always-unchecked-cred-edit-forms-editing-specific-post/

But, this will only get solved in the upcoming version of CRED.

#732843

This is resolved in the current CRED Version you can download from the Toolset Download Area.

Thanks for your patience!

#735620

great. thanks!!