If you ever wanted to create a rollover buttons on your web page, then you probably know that JavaScript code is the only choice you have. But what if you want to have rollover buttons with @formula behind!? Here is how to do it:
If you are reading this tip, then you should know that for the action hotspots (with @formula) Domino generates the _doClick(v, o, t) function.
If you look in to the source code of your page then for the action hotspot you will see something like
onClick="return _doClick('e662ee54e6165298852569d7004f3d44/$Body/0.3B2E', this, null)"
So, if we could get the first parameter, then we could reuse it by writing our own _doClick function in the onClick event of our rollover buttons (with the same second and third parameters of course). In other words, on our form we will have the action hotspots that we will hide on web page and use only to retrieve the Domino generated _doClick's first parameter for our own _doClick.
Lets consider an example.
<A href="#" onMouseOver="..your onmouseover function.." onMouseOut="..your onmouseout function.." onClick="return _doClick(mystr, this, null)"><IMG SRC=...></A>
Note the first parameter for the _doClick function. As you already guessed, by the time your page is loaded 'mystr' will hold the same value as it was generated by Domino for the action hotspot.
Another advantage of this approach is that later when you need to change your @formula you don't need to worry about anything. Whatever Domino will generate it will always be put in to our "mystr" parameter.
The code works on both IE and Netscape browsers. The only exception for Netscape is that it has to be version 6 (as the earlier versions do not support DOM methods used in this code).
This was first published in July 2001