Calling A Javascript Routine From A Hotspot

It is amazingly easy to call a JavaScript routine from a text or graphic
hotspot, but you may not find this in any Lotus documentation. This uses the
javascript: psuedo-URL, which is described in the Link Object section of Danny
Goodman's JavaScript Bible. This can also be used to call JavaScript routine's
directly from the location bar for testing purposes also.
1. Declare your Javascript function somewhere near the top of the form (doesn't
have to be in HTMLHead, and the syntax is much easier using pass-thru HTML)
2. Mark your text or graphic area, and select Create...Hotspot...URL link
3. In the URL link box, type (without quotes): "javascript:void

That's it! This works whether or not the database uses the "Use Javascript
when generating pages option".

Example - to have a graphic button (Archive doc) pop up a dialog box to prompt
for a number, set a flag for the WebQuerySave agent, and save the document:

In pass-thru HTML:
function getArchiveNum ()
var ArchiveNum = prompt("Enter the archive number for this document: ", "
if (ArchiveNum != null) {
document.forms[0].ArchiveNum.value = ArchiveNum
document.forms[0].ArchiveNow.value = 1
} else {
alert("The document cannot be archived without an archive number")

In the URL link box for the hotspot:
javascript:void getArchiveNum()

This was first published in November 2000

Dig Deeper on Domino Resources - Part 2



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...