Script Categories













Forms >>> Time Out.

Limit the time allowed for form input with this short script.

Time Remaining:

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var i = 0;
var done = 0;
var totalSecs = 10;
function SecondPast() {
if(totalSecs != null) timerId = setTimeout("SecondPast()", 1000);
if(i < totalSecs) {
i += 1;
document.clock.seconds.value = totalSecs - i;
   }
}
function doSub() {
if(i < totalSecs) {
done = true;
}
else {
alert("Sorry, you exceeded the time limit.");
done = false;
}
return done;
}
window.onload=SecondPast;
//  End -->
</script>
<form name="clock" onSubmit="return doSub();">
Time Remaining:
<input type=text name="seconds" value="0" size=6>
<br>
<
br>
<input type=textbox name="info" value="Test to submit">
<input
type=submit value="Submit">
</form>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©