hide next button until audio complete | XM Community
Solved

hide next button until audio complete

  • 19 March 2019
  • 5 replies
  • 80 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?
icon

Best answer by TomG 20 March 2019, 02:51

View original

5 replies

Userlevel 7
Badge +27
```
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#NextButton").hide();
jQuery("#"+this.questionId+" audio").on("ended", function() { jQuery("#NextButton").show; });
});
```
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
Userlevel 7
Badge +27
> @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(); });
});
```

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

Userlevel 7
Badge +22

Hui - Use the accepted answer code

Leave a Reply