Show confirmation message on clicking submit button in NITRO Forms

Applies to:

Crow Canyon NITRO activated sites in:
SharePoint Online and On-Premises 2013/2016/2019/SharePoint Server Subscription Edition

Description

It is a common requirement to show a confirmation message before form submission. This helps in delivering a message to user before they confirm form submission. It is also helpful in case submit button is unintentionally clicked by the user.

In this article, confirmation box is shown to get confirmation about NITRO form submission. On clicking submit button, confirmation box pops up, the user will have to click either “OK” or “Cancel” to proceed. If user clicks “OK” then the form is submitted. Else the form is not submitted, and a message is displayed above the ‘Submit’ button. The user can then make required changes and resubmit the form.

Detailed Steps

  1. Hide ‘Save’ button from the NITRO Forms.

Go to the list -> List Settings -> Crow Canyon NITRO Forms -> Expand ‘Layouts and Theme’ section from right hand panel -> Check ‘Hide Save Button’.

  1. Add ‘Submit Action’ to the form.

Expand ‘Actions’ menu -> drag and drop ‘Submit Action’ on to the form.

  1. Configure ‘Pre-Save Process’ script. 

From ‘Button Settings’ in right hand panel, click ‘Edit’ button to configure ‘Pre-Save Process’ script. 

Pre-Save Process Script:

if (confirm("Do you want to submit the form?") == true) {
    functionCallback();
}
else
{
functionCallback(true, "Please click 'Submit' after making required changes on the form.");
}

Note:

  • Replace “Do you want to submit the form?” with required confirmation message.
  • Replace “Please click ‘Submit’ after making required changes on the form.” with required message displayed on clicking ‘Cancel’.
  1. Apply settings and publish the NITRO Forms.

Sample output:

Confirm box pops up on clicking ‘Submit’.

The form is submitted on clicking ‘OK’. A message is displayed if user clicks ‘Cancel’ and user will have to click Submit button again after making required changes on the form.