Make radio buttons images | Community
Skip to main content
Nicholas_Manojl
Level 8
June 15, 2015
Solved

Make radio buttons images

  • June 15, 2015
  • 3 replies
  • 2090 views

Hi all

I'm attempting to make some radio buttons in a form appear as separate images.

Has anyone attempted this?

Here is a working example [Edit fiddle - JSFiddle​] , but unfortunately Marketo doesn't assign a class for each radio label (as far as I can tell).

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 SanfordWhiteman

Just add the classes yourself, as in MktoForms2 :: Radio Button Images

3 replies

June 15, 2015

@Nicholas Manojlovic​ Good morning from California. FYI. I moved your post to the Products and Support

Since it's a product related question, you might get an answer sooner.

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
June 15, 2015

Just add the classes yourself, as in MktoForms2 :: Radio Button Images

Nicholas_Manojl
Level 8
June 16, 2015

Thanks - I see!

Sweet. Here is how I managed to get a different class on each image:

MktoForms2.loadForm("//app-sj01.marketo.com", "410-XOR-673", 298,

  function(form) {

  var formEl = form.getFormElem()[0];

  {

  var radio = mktoRadio_1176_0,

  label = radio.nextElementSibling;

  radio.className += ' radio123';

  label.className += ' label123';

  var radio = mktoRadio_1176_1,

  label = radio.nextElementSibling;

  radio.className += ' radio223';

  label.className += ' label223';

  }

  });

Thanks loads.

SanfordWhiteman
Level 10
June 16, 2015

OK.  That code looks very hard to maintain (string constants should be kept as separate as possible, and I would recommend using a lookup table of IDs and classes).  But if it works for you...