Reputation: 1198
We would like to integrate audio in an Amazon Mechanical Turk HIT, with buttons to play and increase or decrease volume.
<audio id="player" src="test.mp3"></audio>
<button onclick="document.getElementById('player').play()">Play</button>
<button onclick="document.getElementById('player').volume += 0.1">Vol+ </button>
<button onclick="document.getElementById('player').volume -= 0.1">Vol- </button>
The problem is that any button press is also interpreted as a Submit and the HIT is submitted. How can that be avoided?
Upvotes: 1
Views: 498
Reputation: 7357
Uh, it seems like this is just being caused by a lack of understanding of the HTML <button>
tag, not anything to do with Mechanical Turk.
All buttons submit a form by default unless they have the attribute type="button"
.
This is because, according to the HTML 4.01 specification, the default button type is submit
.
Upvotes: 2