Click save and continue with jquery


Badge +2

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


2 replies

Badge +4

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.

Badge +4

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.

Reply