I have a question - how insert result of JS function in html form? I need to put time (in hh:mm format) into "value" in form. The JS code:
function getHours() {
var d = new Date();
var h = d.getHours();
var m = d.getMinutes();
document.getElementById('clientid').value=h+" "+m;}
The HTML form:
<html>
<form method='post' action='http.example.com/some.php'>
<input type='hidden' name='clientid' id='clientid' value="test" action="javascript:getHours()" />
</form>
</html>
Thank you for your attention!
valueto<input type='hidden' name='clientid' id='clientid' value="test" action="javascript:getHours()" />which ishidden.