hide next button until audio complete | XM Community
Skip to main content
Solved

hide next button until audio complete

  • March 19, 2019
  • 5 replies
  • 157 views

Hello, I'm really struggling to make a set of items work for me (I'm also totally new to Java). I would like the question to do the following: 1-autoplay as soon as the trial starts 2-hide the media buttons 3-hide the "next" button until the audio finishes playing I think I have accomplished 1-2 but can't seem to implement 3. can anyone help?

Best answer by TomG

> @eigsti said: > Thanks for the suggestion. Using your code, the "next" button is disappeared; but it *never* appears (not after the audio finishes, nor after a lengthy wait). Where did I go wrong? I've attached screenshots of the java code, and also the HTML script fort he item show should have parens at the end: ``` Qualtrics.SurveyEngine.addOnReady(function() { jQuery("#NextButton").hide(); jQuery("#"+this.questionId+" audio").on("ended", function() { jQuery("#NextButton").show(); }); }); ```

5 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 20, 2019
``` Qualtrics.SurveyEngine.addOnReady(function() { jQuery("#NextButton").hide(); jQuery("#"+this.questionId+" audio").on("ended", function() { jQuery("#NextButton").show; }); }); ```

  • Author
  • March 20, 2019
Thanks for the suggestion. Using your code, the "next" button is disappeared; but it *never* appears (not after the audio finishes, nor after a lengthy wait). Where did I go wrong? I've attached screenshots of the java code, and also the HTML script fort he item

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • March 20, 2019
> @eigsti said: > Thanks for the suggestion. Using your code, the "next" button is disappeared; but it *never* appears (not after the audio finishes, nor after a lengthy wait). Where did I go wrong? I've attached screenshots of the java code, and also the HTML script fort he item show should have parens at the end: ``` Qualtrics.SurveyEngine.addOnReady(function() { jQuery("#NextButton").hide(); jQuery("#"+this.questionId+" audio").on("ended", function() { jQuery("#NextButton").show(); }); }); ```

  • May 13, 2020

Hi there. Have you solved this problem? I face the same issue now... Thanks in advance!


rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • May 13, 2020

Hui - Use the accepted answer code