Automatically Submit after X Minutes

This form will be submitting automatically after 10 minutes.  This example uses some javaScript in the onNew event to programmatically trigger the submit button.  The javaScript is:

setTimeout(function(){ var actionButtons = form.getStageActions(); for(var i=0; i<actionButtons.length; i++){   if(get(actionButtons, i).getId() === 'S_Submit')      get(actionButtons, i).activate(); }},600000);


There are some key things to remember:

  1. You must redirect user after the form submission, in the properties of the Submit button in the Stages tab

  2. You must change the form to render in the next stage

If you do not do one of these two things then this will cause the form to get stuck in an endless loop of opening a new form and then submitting it (which becomes really apparent if you shorten the submit timing to 1s).  However if a user closes the form then the javaScript is not executed.

This form re-directs to https://hclwiki.atlassian.net/wiki/spaces/HDV/overview