jQuery: Add Button to div#Buttons | XM Community
Skip to main content
Solved

jQuery: Add Button to div#Buttons

  • September 28, 2018
  • 1 reply
  • 994 views

Forum|alt.badge.img+3
  • Level 1 ●
  • 24 replies
Is there a simple way to add a custom button to the #Buttons div? I'm sure I saw a post with jQuery or Qualtrics Javascript API instructions, but now I can't find it.

Best answer by red5

Found the article. This code adds a test button. The value attribute is what displays as the button's text. Qualtrics.SurveyEngine.addOnload(function() { jQuery('#Buttons').append('<input id="TestButton" class="NextButton Button" title="Test Button" type="button" name="TestButton" value="TestButton" data-runtime-disabled="runtime.Disabled" data-runtime-aria-label="runtime.ariaLabel" data-runtime-hide="runtime.Hide" aria-label="Test Button">'); }); Here is the original article with a different example of using jQuery to append and clone: https://www.qualtrics.com/community/discussion/1431/floating-submit-button Note: you might need to add css to make the appended button look like the others.

1 reply

Forum|alt.badge.img+3
  • Author
  • Level 1 ●
  • 24 replies
  • Answer
  • September 28, 2018
Found the article. This code adds a test button. The value attribute is what displays as the button's text. Qualtrics.SurveyEngine.addOnload(function() { jQuery('#Buttons').append('<input id="TestButton" class="NextButton Button" title="Test Button" type="button" name="TestButton" value="TestButton" data-runtime-disabled="runtime.Disabled" data-runtime-aria-label="runtime.ariaLabel" data-runtime-hide="runtime.Hide" aria-label="Test Button">'); }); Here is the original article with a different example of using jQuery to append and clone: https://www.qualtrics.com/community/discussion/1431/floating-submit-button Note: you might need to add css to make the appended button look like the others.