SOLVED

Re: Make radio buttons images

Go to solution
Nicholas_Manojl
Level 9

Make radio buttons images

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).

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Make radio buttons images

4 REPLIES 4
Anonymous
Not applicable

Re: Make radio buttons images

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

Re: Make radio buttons images

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

Nicholas_Manojl
Level 9

Re: Make radio buttons images

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

Re: Make radio buttons images

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...