How to tell whether checkbox field was checked (true) or not (false)

Anonymous
Not applicable

Re: How to tell whether checkbox field was checked (true) or not (false)

Ok, but how do I get the checkbox to show on the left?

On Mon, Sep 12, 2016 at 2:27 PM, Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

Re: How to tell whether checkbox field was checked (true) or not (false)

You can switch Checkbox fields to display like Checkboxes fields with this snippet:

MktoForms2.whenRendered(function(form){

  var switchCheckboxLabelsFor = '#Sales__Current_Assets__c'; // replace with a list of the relevant checkbox fields on your form

  [].forEach.call(document.querySelectorAll(switchCheckboxLabelsFor),function(cb){

    [].reduce.call(document.querySelectorAll('LABEL[for="' + cb.id + '"]'),function(prev,next){

      if (!prev.hasAttribute('data-touched-label')) {

        next.textContent = prev.textContent, prev.textContent = '', prev.setAttribute('data-touched-label','');

      }

      return next;

    });

  });

});