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

Moving multiple choice buttons within a question?

  • June 23, 2020
  • 3 replies
  • 26 views

Forum|alt.badge.img

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

Best answer by rondev

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

3 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • June 23, 2020

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


SurajK
QPN Level 3 ●●●
Forum|alt.badge.img+4
  • QPN Level 3 ●●●
  • June 23, 2020

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


Forum|alt.badge.img
  • Author
  • June 23, 2020

Brilliant, that worked. Many thanks!