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

Changing the text of Next button for only one question

  • Jul 31, 2021 5:34 AM UTC
  • 4 replies
  • 3434 views

Forum|alt.badge.img+2

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 ●●●●●●●
  • Jul 31, 2021 8:15 PM UTC

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 ●●●●●●
  • Answer
  • Aug 2, 2021 1:17 PM UTC

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
  • Jun 27, 2023 3:48 PM UTC

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 ●●
  • Aug 8, 2023 9:09 PM UTC

This required slightly different class selection for me as follows:

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