Shifting / repositioning multiple choice answers | XM Community
Skip to main content

Hi, I want to shift the answers so they line up with the choices:

I want to do this for 80 questions that are formatted identically. Can you help me please?

The best option would be to include the price ($9.99/lb) in the choice label (Product A). That eliminates the need for a Price/lb label.

An alternative is the use JS to move the choices inside your price table (I’m assuming it is a table).



@TomG

It is a png image with a ton of stuff above the price, so the answers just need to be shifted. I’ve been reading up on the forum but cannot find a JS code that shifts the multiple choice answers to the right like I need it to.



@TomG

It is a png image with a ton of stuff above the price, so the answers just need to be shifted. I’ve been reading up on the forum but cannot find a JS code that shifts the multiple choice answers to the right like I need it to.

Assuming the choices are horizontal, if you make the width of the image 100%, then you can use JS to add a table cell before the first choice and make the cell widths match the percentage widths of the items in the image (e.g., 25% each). 


Thank you @TomG , the image is 100%. How do I add a table cell? 

It seems like whatever I add in the Javascript code does not change anything whatsoever. Does it matter what layout I’m using? I’m using Classic right now. I was using Simple before but apparently it does not allow for custom code.


Classic is the best layout for what you want to do.  Your JS might have an error which stops it from running. I’m not sure what else you’ve done, because if your choices are Horizontal they should take up 100% of the width.

Anyway, your JS could be something like this:

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .ChoiceStructure tr").prepend("<td></td>").find("td").each(function() { this.setAttribute("width","25%"); });
});

 


@TomG  you are a kind and intelligent soul. Thank you much!

 


Leave a Reply