Changing the text of Next button for only one question | XM Community
Solved

Changing the text of Next button for only one question

  • 31 July 2021
  • 4 replies
  • 1573 views

Userlevel 2
Badge +2
  • Level 2 ●●
  • 2 replies

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

icon

Best answer by MatthewM 2 August 2021, 15:17

View original

4 replies

Userlevel 7
Badge +21

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"

Userlevel 7
Badge +30

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

image.png

Badge +3

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

 

Userlevel 3
Badge +8

This required slightly different class selection for me as follows:

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

Leave a Reply