Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q620 How can I warn that a form submission is due after 25 minutes then submit after a further five minutes?

You are here: irt.org | FAQ | JavaScript | Date | Q620 [ previous next ]

Try:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function first() {
    alert('Five minutes left');
    setTimeout('second()',(1000*60*5));
}

function second() {
    document.myForm.submit();
}
//--></SCRIPT>
</HEAD>

<BODY onLoad="setTimeout('first()',(1000*60*25)">

<FORM NAME="myForm">

...

<INPUT TYPE="SUBMIT">
</FORM>

</BODY>
</HTML>

However, this will not submit a form where the action is mailto:

©2018 Martin Webb