A trick for closing JavaScript windows

A trick for closing JavaScript windows

Every so often I'm forced to use pop windows in domino. They're really easy to create, but not so easy to kill after you submit data to them... Yea JavaScript can be used but the onSubmit and onload/unload functions have their limits. Especially if you're trying to save the data submitted and kill the window. So here's my dirty little trick...

First create a form, call it what you will. I typically call it 'Goaway'.

In my world the form is blank save for the following line entered in the HTML Body Attribute of the form:

"onLoad=window.close()"

In my forms which popup, I put the following lines behind a button or hotspot depending on the design.

@Command([FileSave]);@Command([Compose];"Goaway")

When the action is triggered the document in the window gets saved and then within the same window the 'goaway' form is loaded. When that form loads it automatically closes the window.

That's it, data saved, window closed... process as usual.

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

This was first published in April 2003

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.