Creating an action button on a Web form

I have a Web form that I want to put an action button on. When clicked, it should open the current document with a different form and then print it.
You can create a view selecting the documents you want to be able to display. In the form formula for the view (e.g., altDisplayView), enter a formula to return the correct form name you wish to display as the alternate form, e.g., "MyDisplayForm." Then your action button could open the document from the altDisplayView in a new window, which would then display the new version of the document. If you want the print dialog to be launched automatically, add the following JavaScript to the form's onLoad event: window.print().

MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A:

I honestly don't think this question was properly addressed. The user has a form (not multiple forms) that he wants displayed on a different form. In this scenario, the user is displaying a document that has a button. The solution should address this scenario.

I think a better solution would be to have a button on the form that, when pressed, runs an agent that gets a handle to the document, and either copies it or resets the form field to the new form and redisplays it (or the copy -- which can be flagged for deletion after it is closed). I do a lot of Domino Web development. The nice thing about it is that you can use agents to easily accomplish elegant solutions that are not as easily achievable in the Notes client.

—Susan L.


Do you have comments on this Ask the Expert question and response? Let us know.

This was first published in October 2004