Yesterday I was adding an edit button to a form. Normally I add the following passthru:
<input type="button" onclick="location.search='?Edit'" />
If you look at the source code of this page you'll notice the first and last elements of the <body> are two empty forms. The first one is started by Domino and terminated by me. The last one is started by me and finished off by Domino. The usual Domino form spans the whole of the page, whether it's needed or not. By adding a closing and opening <form> to the first and last line of my Forms in Domino Designer I can get rid of this form. Whether any forms exist on the page is now down to me (Note: Forms can't be nested!). We can now add as many forms as we like and make them do whatever we please.
To create an edit button on a document you might think you simply add:
<form method="get" action="view/docid?EditDocument"> <input type="submit" value="Edit" /> </form>The trouble is that forms using the GET method create their own Query_String, based on the field values of the form (not so with POST). With this form we end up with a URL that doesn't include "EditDocument" and is simply "view/docid?". Domino doesn't like this. So we need to add a field to the form called EditDocument, like so:
<form method="get" action="view/docid?EditDocument"> <input type="text" name="EditDocument" value="1" /> <input type="submit" value="Edit" /> </form>
Pressing the "submit" button results in the URL:
Domino ignores the "=1" part and takes its command from the first parameter of the Query_String - EditDocument in this case.
There you go then. A fully accessible edit button on a document. It's fun hacking Domino isn't it.