CMS MADE SIMPLE FORGE

CGBetterForms

 

[#11738] Checkboxes submitting checked value whether checked or not

avatar
Created By: Lewis Howles (lewishowles)
Date Submitted: Thu Feb 15 08:13:02 -0500 2018

Assigned To: Robert Campbell (calguy1000)
Version: 1.3.2
CMSMS Version: 2.2.5
Severity: None
Resolution: Works For Me
State: Closed
Summary:
Checkboxes submitting checked value whether checked or not
Detailed Description:
Hard to pin this one down, but I've tried the following two options when adding
a checkbox to a form:

https://codepen.io/lewishowles/pen/mXBoRg

And on the submission form I've tried both the standard {$gdpr_telephone}
variable, and the {$_gdpr_telephone} raw option.

Whatever I try, it seems to always output 'Yes' in the email, whether checked or
not. Of course in the first example, I'd expect empty string and in the second
I'd expect No.

I could be doing something stupid.

If I change this into a select instead of a checkbox, it works perfectly as
expected.


History

Comments
avatar
Date: 2018-02-17 16:06
Posted By: Robert Campbell (calguy1000)

Just tested here.   No issues.

      
avatar
Date: 2018-03-15 07:05
Posted By: Lewis Howles (lewishowles)

Still getting this one on a new site. Whether a checkbox is checked or not, its
full value is sent through in email dispositions. Just tried updating to the new
version but no change.

If there are hidden fields of the same name to attempt to pass an 'unchecked
value', it's ignored.

If an array is used for the name, only the last entry is sent - and again it's
the same whether the checkbox is checked or not.

Please could you include the form code you used where it worked?
      
Updates

Updated: 2018-09-22 17:32
state: Open => Closed

Updated: 2018-02-17 16:06
resolution_id: 5 => 11

Updated: 2018-02-17 16:06
resolution_id: => 5