Moving multiple choice buttons within a question? | XM Community
Skip to main content

Hi all,
I'd like to move the multiple choice buttons (accept / reject) to within the body of the question text, do you know if this is possible? At the moment I have this:
Screenshot 2020-06-23 at 16.35.04.pngThe table is set up using HTML. But would prefer to have this:
Screenshot 2020-06-23 at 16.35.04.pngIs this possible to do using JS? I'd prefer not to split the question into multiple questions as it would mean splitting hundreds of questions.
Many thanks,
Chris

In the multi choice question text html view just paste the below code, where you want to show the multi choice button:

 

After this, paste the below code in the JS of the multi choice question:
var el = jQuery('#'+this.questionId+' .QuestionBody').detach();
  jQuery('#'+this.questionId+' #customoption').html(el);


Just add the html code of buttons in the question text before the table or you can just add the buttons before the html table using the JS if your table also created using html tags,
jQuery('.ClassNameofButtons').before('.classNameOfhtmlTable')


Brilliant, that worked. Many thanks!


Leave a Reply