Changing the text of Next button for only one question | XM Community
Skip to main content
Solved

Changing the text of Next button for only one question


Forum|alt.badge.img+2
  • Level 2 ●●
  • 3 replies

I would like to change the next button to "Yes" Instead of "next" for only ONE question.
How can I do this?

Best answer by MatthewM

Another way is to put the question in its own Block, and change the text in the Next/Previous button text option.

image.png

View original

4 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2028 replies
  • July 31, 2021

You can't change it for the question, you can change it for a Page though.
Add this to any question on the page:

document.querySelector("#NextButton").value = "Yes"


MatthewM
Level 6 ●●●●●●
Forum|alt.badge.img+30
  • Level 6 ●●●●●●
  • 1067 replies
  • Answer
  • August 2, 2021

Another way is to put the question in its own Block, and change the text in the Next/Previous button text option.

image.png


Forum|alt.badge.img+3
  • 2 replies
  • June 27, 2023

It looks like the code is slightly different when using the simple layout. This worked for me in the Onload section using the Simple Layout. 

document.querySelector('#next-button').textContent = 'Submit';

 


Forum|alt.badge.img+8
  • Level 2 ●●
  • 23 replies
  • August 8, 2023

This required slightly different class selection for me as follows:

 document.querySelector("#NextButton.NextButton.Button").value = "Submit"


Leave a Reply