I have an auto submit on some forms where audio is playing, it’s simple code and it’s worked for months, but since the update isn’t working. I’d appreciate any help!
Here is the code:
> <h2 id="heading" style="display:block; text-align:center;"><a onclick="playAudio()"><u>Volume Up - Click Me</u></a></h2>
>
> <audio id="audio">
> <source src="https://moebiusinc.com/wp-content/uploads/2021/04/mixdown-1.mp3" type="audio/mpeg">
> Your browser does not support the audio element.
> </audio>
>
> <script>
>
> var audioStore = document.getElementById("audio");
>
> function playAudio() {
> audioStore.volume = 0.5;
> audioStore.play();
> }
>
> document.querySelector('audio').addEventListener('ended',function()
> {
> jQuery( 'form#gform_1' ).trigger( 'submit' );
> }, false);
> </script>
Many thanks in advance