1 Reply Latest reply on Jan 15, 2019 11:17 AM by Sanford Whiteman

    Why is Marketo creating a duplicate form Label?

    Homero Cavazos

      In trying to stay ADA compliant but the form generator creates a blank duplicate label for checkboxes. Is this a bug? Is there a fix? See screenshot.

       

      Thanks in advance

       

      duplicateLabel.gif

        • Re: Why is Marketo creating a duplicate form Label?
          Sanford Whiteman

          It's because of the possible different order of Checkbox and Checkboxes fields relative to their labels.

           

          You can delete the empty labels using JS if you want, this should do it:

           

          MktoForms2.whenRendered(function(form){
            var formEl = form.getFormElem()[0],
                  emptyLabels = formEl.querySelectorAll("label:empty"),
                  arrayify = getSelection.call.bind([].slice);
          
            arrayify(emptyLabels).forEach(function(labelEl){
              labelEl.parentNode.removeChild(labelEl);
            });
          });