SOLVED

Re: Checked checkbox = false

Go to solution
James_Glavin
Level 5

Checked checkbox = false

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

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Josh_Hill13
Level 10 - Champion Alumni

Re: Checked checkbox = false

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.

View solution in original post

7 REPLIES 7
Dory_Viscoglio
Level 10

Re: Checked checkbox = false

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
Level 10 - Champion Alumni

Re: Checked checkbox = false

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 5

Re: Checked checkbox = false

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 - Community Moderator

Re: Checked checkbox = false

@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 5

Re: Checked checkbox = false

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 - Community Moderator

Re: Checked checkbox = false

OK... but I did provide code that is dirt-simple to use on your site!
James_Glavin
Level 5

Re: Checked checkbox = false

Thanks Sanford, I do appreciate it!