In this example, you add a rule action that closes the browser window when the form user clicks the OK button on the confirmation dialog. If the form user clicks the Cancel button on the confirmation dialog, the dialog closes and nothing else happens. This step demonstrates how to add the Get confirmation from user action with basic configuration.
- Edit the Students Item view and click the Rules tab. Click Add Rule. First, you add an event, or when the rule should run. In this case, the event is when someone clicks the Close button.

- With the Events tab active, click When a control on the View raises an event (under the Control Events heading) to add it to the rule definition pane. Click select control and select Close Button. K2 automatically completes the event with Clicked.

- With the Actions tab active, click Get confirmation from user (under the Notifications heading) to add it to the rule definition pane.

- Click specify heading. Enter
Confirm Close
and click OK.

- Click specify message and enter
Are you sure you want to close this form? You will lose any information you entered.
and click OK.

With the basic configuration, you add the action(s) you want to execute if the form user clicks the OK button on the confirmation dialog. The actions execute immediately after the OK button is clicked. You don't add any actions for the Cancel button. By default, clicking the Cancel button on the dialog closes the dialog and does nothing else.
- With the Actions tab active, click Close the browser window (under the Browser Interaction heading) to add it to the rule definition pane. There are no other settings, so click OK to save the rule. Click Finish to save and exit the view.

- To test the confirmation dialog, select the Students Item view and click the Run icon (found in the central pane).

- Click the Close button. Click Cancel on the confirmation dialog. The dialog closes and you are returned to the view. (No other actions execute at this point.) Click the Close button once again. Click OK on the confirmation dialog. The browser window closes.
