Skip to main content

Hello Everyone,

 

Recently I was tasked with creating a form that has both "Save and Submit" and "Save" buttons. The "save" button is to be used to save the form without causing validation. When "save and submit" is selected it will cause validation and push the document to another workflow. As most of you know this is not an out of the box feature, when doing some digging I found a solution to this issue.

 

The solution I found to get around the validation issue on "Save" was to add a {return true} in the button's client click section.

 

When perusing the inspect element window I came across the "Save" button's OOTB onclick function.

 

  "if (!NWF.FormFiller.Functions.ProcessFormsValidation(this, 'NfValidationGroupctl00PlaceHolderMainformFiller', function () { })) { return false; };WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$PlaceHolderMain$formFiller$FormView$ctl102$3f616cae_5351_4996_be4f_f42e7b224857", "", true, "NfValidationGroupctl00PlaceHolderMainformFiller", "", false, false))"

 

What happens here is the form first checks validations, the field is set to false until it returns true, which will happen if the controls are valid. By adding a {return true} on the client click, it will override the Nintex OOTB validation check and submit as intended.

 

I hope this helps for those looking for a way to save something without running validations.

 

EDIT: After some more playing around with this solution I found that if you have fields set to required through SP, this will not work. This will only work if you have your validations on the form directly.

Awesome investigative work, I'll certainly bookmark this one for future use.


Thank you! I hope you find it helpful.


finally found the solution for this- i have been stuck for several days!

thank you so much


Didn't work for me. The button still triggers validation(s).


This didn't work for me either. Does this solution not work for Nintex Forms in SharePoint Online?


It doesn't work for me on Nintex Forms for SharePoint O365.


Does anyone know if there is an alternative method for accomplishing this same solution in SharePoint Online? Any help would be greatly appreciated. Thank you.


@Daniel Morgan

Are you on prem or online? 


Hey All,

I am unaware of whether this will work on 365, we have on prem only, but will be moving to 365 in the future. So its good to know that another solution will need to be found.

My recommendation would be to go into the dom and follow the onclick function of the 365 button and see if you can manipulate the validation to force true.


I think this may be a potential solution for online/O365. Slightly convoluted, but should suffice until Nintex (hopefully) release the functionality:

https://community.nintex.com/message/51360-how-to-apply-rules-according-to-click-on-draft-button-or-submit-button


Thank you for this, I will keep this post in mind for when we move to O365.

I will also reply to this thread if I can figure out a more streamline solution when we move online.


The client click feature is not available in responsive forms unfortunately. Is it possible to achieve this feature in responsive forms without having to use javascript?


Brilliant!  Works like a charm, thank you so much!


Is there a way to get this to work but still stop submission if there are invalid fields?
i have a form with two ‘save and submit’ buttons. I am using this client click on the first button so it submits without picking up required fields on the remainder of the form but i still need it to stop submission if fields prior to this button are invalid


Reply