0

Hello Everybody

I am developing a small project on word game. My requirement is that I have to show time out say of 25 secs on JSP page.

Code which I am using is

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">

var timer = null

Function start(){
	var time = new Date()
    var hours = time.getHours()
    var minutes = time.getMinutes()
    minutes=((minutes < 10) ? "0" : "") + minutes
    var seconds = time.getSeconds()
    seconds=((seconds < 10) ? "0" : "") + seconds
    var clock = hours + ":" + minutes + ":" + seconds
    document.forms[0].display.value = clock
	 timer = setTimeout("start()",25000)
}


</script>

</head>
<body onload="startup()">
<form action="SecondServlet">
<table BORDER=0 CELLSPACING=23 CELLPADDING=0>

	<tr>
		<td><b> WORD <input type="text" name="word"> </input> </b></td>
	</tr>


	<tr>
		<td vertical align=right><b> Ans <input type="text"
			name="yourAns"> </b></td>
	</tr>


	<tr>
		<td vertical align=center><b> SUBMIT <input type="submit"
			name="submit" value="Submit"> </input></b></td>
	</tr>







</table>
</form>

</body>
</html>

Help in any form will be appreciated.
Thanks.

Edited by anupam.j2ee: n/a

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by anupam.j2ee
0

Gootle HTML refresh

Thanks

Actually I need to show a timer on the jsp page say of 25 sec, which indicate that user has just 25 sec to answer the question.

0

Use setTimeout() in JavaScript to display the time. You could simple search for a sample on how to do setTimeout() on the Internet.

0

Use setTimeout() in JavaScript to display the time. You could simple search for a sample on how to do setTimeout() on the Internet.

THANKS:icon_smile:

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.