Nintex Forms O365 Submit button Custom JavaScript validation not working


We are using Nintex Forms O365. We are using the Client Click function of Submit button and specify this:

 

return validateFormSubmission()

 

And the actual JavaScript is:

 

function validateFormSubmission(){var formValidateMessage = validateMandatoryFormFields();if(formValidateMessage != ""){alert(formValidateMessage);return false;}else{return true;}}

It throws the alert just fine; however, even if it returns false, it still pushes through in the "Saving" action. Also, it doesn't really "save" it. It is just stuck on the "Saving" screen.

 

In Nintex Forms 2013 on-premise this is working fine.

 

Is there a difference in how to implement in O365?


5 replies

Badge +17

@lalcabasa what are you attempting to validate? Sorry I didn't look through the JS much. Also, we have the new rules engine which helps with validations on some level that may be of interest. Its part of the New Responsive Forms Designer. 


 


Ping @EuanGamble for info on how to get access.

I have the same problem when I tried to convert javascript to SharePoint 365


Do you find the solution?


 


It is just terrible to use Ninbtex form in SharePoint Online

We are experiencing same issue after migrating Nintex form(s) from SharePoint 2013 On Premise to SharePoint Online.


If button type is 'Save' or "Save and submit" and validation code is added to the "Advanced> Client click" the form continues with Save operation ignoring "return false;" statement and it freezes the browser. (waited 5-10 minutes).


Why do we use JavaScript validation instead of Rules?  Because rules are useful with complete form validation. When end users want to save a Draft they do not want to fill complete form. At times complete form data is not available but the business needs to move forward. JavaScript provides the flexibility to handle partial and complex configurations. It is also faster to code validation when there are large number of fields and/or the requirements frequently change. 

Badge +1
Same issue here after Sharegate Migration.
Badge +6

I also run into the same issue.


If you remove the 'return' from the Client Click Setting, the Saving screen does not get stuck but still changes on the list item are changed even if the validation function returns false.


 


From the documentation there is no description on how to validate on the save button click with custom JavaScript.


 


We need to calculate a sum on list items and compare against a guideline and we want to avoid saving if the guideline is not fullfilled.


 


So what is the exact path to run a validation function on a Save Button and have the ability to abort saving?

Reply