hide next button until audio complete | XM Community
Skip to main content
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?
```

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
> @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!


Hui - Use the accepted answer code


Leave a Reply