Elderberg Posted July 24, 2020 Report Share Posted July 24, 2020 I've inserted the following into an html block: <input type="button" name="Mod0CancelRecord1" value="CANCEL" class="cbBackButton"> And then in the footer i've inserted: document.getElementsByName('Mod0CancelRecord1')[0].onclick = function(){ if (confirm("Close Window?")) { window.close(); } }; but unfortunately i've discovered : Quote This method can only be called on windows that were opened by a script using the Window.open() method. If the window was not opened by a script, an error similar to this one appears in the console: Scripts may not close windows that were not opened by script. Any ideas or suggestions are welcome Quote Link to comment Share on other sites More sharing options...
AtayBalunbalunan Posted July 26, 2020 Report Share Posted July 26, 2020 Suggestions in https://stackoverflow.com/questions/23306882/javascript-close-current-window may work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.