Checked checkbox = false | Community
Skip to main content
James_Glavin
Level 4
March 16, 2015
Solved

Checked checkbox = false

  • March 16, 2015
  • 7 replies
  • 3360 views

Hi there,

How would I go about setting up a field on a form, so that if someone checks the box, it's recorded as a "false" response, and if it is left unchecked, the response is recorded as "true".

Is that possible?

Thanks,

James

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Josh_Hill13
You should be able to flip them in the radio button or check box. But why not use a Yes/No?

Yes=FALSE
No=TRUE.

7 replies

Dory_Viscoglio
Level 10
March 16, 2015
Rephrase the question? Haha, short of that you might have two fields - one for the form and one as the actual field. If someone marks the form field true, then use a data management campaign to change the actual field to false. And vice versa for false. 
Josh_Hill13
Josh_Hill13Accepted solution
Level 10
March 16, 2015
You should be able to flip them in the radio button or check box. But why not use a Yes/No?

Yes=FALSE
No=TRUE.
James_Glavin
Level 4
March 16, 2015
Hi Dory - Sadly rephrasing the question isn't an option, although I did suggest it! ;) I think having two fields plus campaign could work. Thanks for the idea!

Josh - a Yes/No might be the solution here. But if I did want to flip the check box, how could I make that work?
SanfordWhiteman
Level 10
March 17, 2015
@James G Simple stuff:

        form.onSubmit(function(form){
            form.vals({
                My_Checkbox__c : ( 'yes' == form.vals().My_Checkbox__c ? 'no' : 'yes' )
            });        
        });

Demo here.
James_Glavin
Level 4
March 18, 2015
Simple to you, maybe Sanford! ;) 

I'm going with Josh's idea of using a Select field type, and defining Yes to mean False and No to mean True.

Thanks everyone for your input.

James
SanfordWhiteman
Level 10
March 18, 2015
OK... but I did provide code that is dirt-simple to use on your site!
James_Glavin
Level 4
March 18, 2015
Thanks Sanford, I do appreciate it!