|
The
key to the display updates is code associated with the onMouseOver
event, as shown here for Button 1
<input
type="button" value="Button 1" onmouseover="Menu1(this.form);">
This
code framework is replicated for each button.
The
function called updates the contents of the text area below the
buttons:
function
Menu1(form)
{
form.TXTVal.value="Button
1 shows this message when the mouse passes over" + ClearMessage;
}
Note
that the parameter this.form
- the identifier for the form - is passed to the function from the
onMouseOver event so that the text area in the form can be properly
identified in the script, using form.TXTVal.val.
ClearMessage is a
variable containg the prompt to Click
on this text box to clear messages and status line, preceeded
by a couple of new-lines.
Pointing
at Button 3 does much the same updates as Button 2 but clicking
on it changes the window location to the site map page (sitemap.htm).
This is done using attached JavaScript rather than calling a function.
It emulates a HTML hyperlink.
<input
type="button" value="Button 3"
onmouseover="Menu3(this.form);"
onclick="javascript:window.location='../../../pages/sitemap.htm';">
Clicking
on the text area clears the display and the status line, again by
calling a function. This function simply writes a null string (that
is, "") to the text area and the status line.
<TEXTAREA
NAME="TXTVal" COLS="60" WRAP="VIRTUAL"
onClick="ClearText(this.form)"
ROWS="4">
</TEXTAREA>
onClick
calls the ClearText function:
function
ClearText(form)
{
form.TXTVal.value=""
window.status="";
}
See
the HTML source of this page to place these in the context of the
page.
|