[Fixed in next Release] If all selections are removed from a checkbox it does not save

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.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Related documentation: Front-end Content Submission and Editing Forms

This topic contains 15 replies, has 2 voices, and was last updated by  Christian Cox 1 week, 2 days ago. The support staff assigned to this topic is Christian Cox.

Viewing 15 posts - 1 through 15 (of 16 total)
Author
Posts
#574200

When I try to save a form, if ALL checkboxes selections are removed it does not save.

If I change a selection (as long as one of the check boxes remains selected) then it will save correctly.

So on the Edit CRED form.png I switched from Beer Glasses to Martini. And I removed the Public Liability Insurance so nothing in that cred_show_group selected at all.

The After Save Cred.png show that the Beer Glasses remained deselected and Martini selected.

But the Public Liability remained selected (I'd saved deselected). It's like one item HAS to remain selected in a group.

Example Code on the CRED form and Field Group image attached.

[cred_show_group if="(STR($(supplier-category)) = REGEX('148'))" mode="fade-slide"]

	<div class="cred-group cred-group-magicians">
		<div class="cred-header"><h4>Magicians</h4></div>
		<div class="cred-field cred-field-magicians-options">
			<label class="cred-label">
Options You Provide
</label>
			[cred_field field='magician-options' post='wedding-supplier' value='' urlparam='']
		</div>
	</div>

[/cred_show_group]
#574277

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Hi, are the values for each checkbox in a single group different? If not, please make sure to use different values for each checkbox in a group.

If the values are already different, then let's try to eliminate other possible issues:

- Please temporarily remove any cred_show_group tags from this edit form and try again:

[cred_show_group if="(STR($(supplier-category)) = REGEX('148'))" mode="fade-slide"]

- Please temporarily remove any conditional display code from these custom fields, and try again.

- Disable plugins except for Toolset and activate a default theme, then try again.

Please let me know the results of these tests and we can go from there.

#574283

To eliminate two options:
Values for each checkbox are different.
I'm not using the Conditional display button for the fields in the group.

I will have to test on my staging site, I'm testing emails from the CRED form currently so don't want to mess this up. Will do in a few days.

#574600

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Understood, I'll mark this ticket as pending an update from you. No need to reply right now, we can pick up again when you're ready to continue.

#575127

OK - I disabled all plugins (except Toolset ones) and switched the theme. Same issue.

I removed all the cred_show_groups from the CRED edit form. This again made no difference.

Also, JFYI I switched to your Toolset Starter theme (twice, on a clean second set up too). Both times I ended up with a:
Request Timeout
This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

My site seemed to grow exponentially too - in fact the first time, I reached my quota all of a sudden and after increasing it reached it again. After removing the staging site in its entirety and trying for a second time it happened again. I found that as soon as I deleted the theme from my back-end all returned to normal and I could activate and use Twenty Seventeen for testing purposes fine.

#575193

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Okay thanks. Please choose "When unchecked, save 0 to the database" in the options for this field. Then update the post several times to test again. If this does not resolve the problem, I'll probably need to create a clone of your site to see what's happening.

#575202

OK, I think I did test for this previously, though I may not have then 'update the post several times to test again' as you requested

I am happy to do this first and then give you access to my staging site but currently I'm now doing another test for my email issue, hopefully by the middle of next week I can send you and update and login credentials for you to look at if an issue still occurs.

Many thanks.

#575221

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Understood, I will stand by for your update.

#576482

I have set the 'Hair' field to "When unchecked, save 0 to the database" and tested many times. There is still a problem if trying to remove all selections. There is a difference now though. If I remove all options, save from the front end and return, both options now remain checked. Before saving 0 to the db, only the original option de-selected remained selected after the save.

If selecting 1+ option(s) and changing that selection all works fine, both before and after setting 0 to the db.

If you mark the next reply as private I can send you login credentials for my staging site.

#576677

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Private reply fields enabled.

#577108

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Hi, both the Hair checkboxes and both the Magician checkboxes store the same value. Please see the attached screenshot. You can see the checkbox "value" is 1, which may be causing the problem you mentioned. Can you update these values to be unique per field group, resave all Hair or Magician posts to import the new values, and try again?

#577418

Hi, I changed Hair and only had this attached to a Post. But no change.

See image attached...

Many thanks.

(PS I'm not being notified via email for some reason, so sorry for the delay).

#577464

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Hi, I changed Hair and only had this attached to a Post. But no change.
Hi, I'm not sure what you mean by "only had this attached to a Post", can you elaborate?

I just logged in and bulk-edited all Suppliers posts by going to Suppliers > All Items, checking all the checkboxes, and using the Bulk Edit option. I didn't actually make any changes to the posts, I just updated them. This is required because we have changed the values that the checkboxes store (or don't store) in the database, and you need to apply the new values to all the posts.

Then, I edited Supplier #3327, and modified the Hair selections. As you can see now, both checkboxes are unchecked. Can you take a look and confirm the Hair checkboxes are behaving as expected now? If not, please show me what's going wrong.

#577570

Hi, what I meant by 'only had this attached to a Post', I'd only got Hair added, not any other field groups. Sorry if not clear.

I see no difference. I updated all the Supplier's posts as you outlined.

Are you using my staging 2 and the update CRED form from the front end?

If you make the next reply private I can give you the URL of the form and the login credentials of the supplier I'm testing on.

Many thanks, Lindsay

#577644

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Yes, please share that info here. Private reply fields are enabled.

Viewing 15 posts - 1 through 15 (of 16 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.