Solution
You have to install a JavaScript library to auto submit the form after a specified time delay.
-
Reference: http://www.webappers.com/2013/10/31/ifvisible-js-check-if-user-is-idle-or-active-on-the-page
The JavaScript library must be installed in the \wfgen\wfapps\webforms\js folder.
On the Web References tab in the Form configuration panel:
-
Check Include jQuery API and jQuery UI libraries.
-
In the textarea, insert the following JavaScript code with an idle duration of your choice:
<script src="/wfgen/wfapps/webforms/js/ifvisible.js"></script>
<script>
$(document).ready(function(){
// Code executed in Runtime only
if (typeof $selectedObject === "undefined")
{
// Set the idle limit to 10 seconds
ifvisible.setIdleDuration(10);
// Confirm save as draft if no activities more than 10 seconds.
ifvisible.idle(function(){
var r = confirm("There are no activities for more than 10 seconds!\nSave this form as draft?");
if (r == true) {
$('#saveAsDraftButton').click();
}
});
}
});
</script>