Applies to: SharePoint online and On-premises (2013, 2016, 2019 and SE)
Description:
NITRO display form has a ‘Close’ button to close the form and go back to the list. If requirement is to redirect to a specific URL after closing the form, then a custom button can be configured. NITRO Forms custom CSS and JavaScript features can be used to hide the default ‘Close’ button and configure a custom button. This document describes the steps to achieve this requirement.
Steps to hide default ‘Close’ button and to configure a close button for redirecting to custom URL
- Navigate to the site -> List -> List settings -> Crow Canyon NITRO Forms -> Expand ‘Advanced’ section from left-hand panel -> Custom CSS. Specify CSS as shown below:
![](https://www.crowcanyon.help/wp-content/uploads/2024/01/732_2.png)
CSS to hide the default close button is given below:
#btnClose
{
display:none;
}
- To show the custom button, configure ‘Form Event Actions’ on form load; from ‘Advanced’ section as shown below:
![](https://www.crowcanyon.help/wp-content/uploads/2024/01/732_3.png)
![](https://www.crowcanyon.help/wp-content/uploads/2024/01/732_4.png)
JavaScript to configure close button and redirect to custom URL:
//Execute script action
![](https://www.crowcanyon.help/wp-content/uploads/2024/01/732_6-1024x167.png)
//Please replace “RedirectURLGoesHere” with the required URL.
![](https://www.crowcanyon.help/wp-content/uploads/2024/01/732_7-1-1024x174.png)
- Save settings and publish the NITRO Forms.
Sample Output:
![](https://www.crowcanyon.help/wp-content/uploads/2024/01/732_5-1024x630.png)
Default ‘Close’ button is hidden and custom button is shown above.