Remove Unchecked Checkboxes ✨
On form submission, it can be difficult to deal with email notifications that contain a huge pile of "false" values.
This attribute will cause those checkbox values to be removed just prior to the form submission, to ensure they do not clutter your email notifications unnecessarily.
How it Works
On form submission,
The form is validated to ensure that the submission will be successful.
If valid, any unchecked checkboxes are then removed so that you will have no false values in your email or in your form history
The form submission is then completed, and Webflow's form handler or your custom form handler
Webflow's email notifications and form submission history handle this very well. The email simply does not contain those items, and the form submission history shows blanks in those columns rather than false
values.
Not tested with reCaptcha- it's possible that if the form is valid, but reCaptcha is not, that the fields could be removed from the form, but the form submission could be prevented by the reCaptcha fail. This is a rare edge case but worth testing if it's important to your situation.
Getting Started
First, add the library as detailed in Quick Start.
Required Attributes
Add wfu-form
wfu-form
Add wfu-form
to the form or form block element directly.
Add wfu-form-checkbox
wfu-form-checkbox
Designate the checkboxes you want removed-if-unchecked with the following attribute and value-
wfu-form-checkbox
= remove-unchecked
Apply this to the element with
wfu-form
on it, if you want all checkboxes to be affectedApply this to an individual checkbox element if you want only specific checkboxes to be affected
Apply this to a grouping element such as a DIV, if you want a specific group of checkboxes to be affected
You can use this attribute on multiple checkbox elements and/or groups.
Optional Attributes
None.
Last updated