lukegullifer
Scholar

Click save and continue with jquery

Hi,

Is it possible to click the save and continue button programatically with jquery or javascript.

I would like to trigger a save and continue after 10 minutes of inactivity on a form

Thanks,

Luke

Tags (1)
Reply
2 Replies
tgauthier
Novice

Re: Click save and continue with jquery

Hi ,

You can try the following : 

 - Set a client ID variable to your save and submit button (ex: varssbutton).

 - Add this line to your custom javascript form setting : setTimeout(function() { NWF$("#" + varssbutton).click(); }, 10000);

 - First, replace 10000 (milliseconds) by a smaller value to test.

Regards,

Thibault.

0 Kudos
Reply
tgauthier
Novice

Re: Click save and continue with jquery

Sorry,

On Office 365, it's not possible to choose a JS Client ID for buttons.

So, here is the code used to do what you want (change sbutton variable according to the button type) : 

NWF$(document).ready(function() {
   setTimeout(function() {
      var sbutton = NWF$("input[value='Save']")[0];
      //var sbutton = NWF$("input[value='Save and Submit']")[0];
      sbutton.click();
   }, 600000);
});

It work's for me.

Regards,

Thibault.

0 Kudos
Reply