No ratings

"Close the browser window" form rule action redirects to about:blank instead of closing the window.




Symptoms



"Close the browser window" form rule action redirects to about:blank instead of closing the window.


Diagnoses



HTML 5 standards dictate that windows that have not been opened by a script cannot be closed by that script: https://www.w3.org/TR/html51/browsers.html#dom-window-close

Here's a community post regarding this issue: http://community.k2.com/t5/K2-blackpearl/Rule-quot-close-the-browser-window-quot-with-different-resu...


Resolution

Create a Literal, Hidden Data Label on your form, and when you wish to close the window, create a Transfer Data rule that transfers the following script into the Data Label:

<script>window.open('', '_self', ''); window.close();</script>

This script opens a blank window on the current page and then closes it, getting around the aforementioned issue.


 




Labels: (1)
Comments

This doesn't appear to work if the page is still in the workspace.

Version history
Last update:
a month ago
Updated by:
Contributors