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

jQuery: Add Button to div#Buttons

  • 28 September 2018
  • 1 reply
  • 669 views

Userlevel 2
Badge +3
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.
icon

Best answer by red5 28 September 2018, 18:20

View original

1 reply

Userlevel 2
Badge +3
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.

Leave a Reply