Tuesday, 20 August 2013

Is it possible to submit the time that's obtained by javascript to a Form?

Is it possible to submit the time that's obtained by javascript to a Form?

This button show the current elapsed time of video media
<button name="test"
onclick="alert(Math.floor(document.getElementById('video').currentTime) +
'secs elapsed!');">Show elapsed time</button>
This elapsed time obviously changes at every second.
Is it possible to submit this elapsed time to a form?
How can I customize the code below?
<form action="/comments" method="post" >
<input type="text" name="comment[body]" size="50" />
<input type="hidden" name="comment[elapsed_time]" value="???????" />
<button type="submit" >Submit!</button>
</form>

No comments:

Post a Comment