whform.js

Whform.js builds and styles the search field for the index and search pane.

Whform.js is used by whfform.htm and whiform.htm.

Variables

Whform.js has several variables controlling the form generated. These variables are given a value in whfform.htm and whiform.htm. Modify those files to amend the way these pages look. These variables are:

Variable Usage
gnMaxRslt The maximum number of search results on a page.
gsHiliteSearchTitle The title for the highlight search results checkbox.
gsMaxSearchTitle The title for the maximum number of search results on a page.
gsTitle The title shown above the search field.
gstrFormName The name of the form.

Functions

This section lists several useful functions in whform.js:

Function Variables Use
getFormHTML   Creates the form.
inImage bImage1 Sets whether the GO button is hovered. If you set this to false, the form will not search when you click the go button. (Will still work by pressing ENTER.)
inputEnable bEnable2 Enable or disable searching by pressing the ENTER key for legacy browsers only.
setBackground sBgImage3 Sets the background image of the page holding the form.
setBackgroundcolor sBgColor4 Sets the background colour of the page holding the form.
setBtnType sType Control is the search button is a text button or an image. Provide text for a text button and image for an image button. (Only for search form.)
setGoImage1 sImage13 Sets the default image for the GO button.
setGoImage2 sImage23 Sets the hover image for the GO button.
setGoImage3 sImage33 Sets the click image for the GO button.
setHighlightSearch bEnable1 Set the option to enable highlighting search results on or off. This function expects a boolean.
writeFormStyle   Writes the styling for the form. Amend the styling by editing this function.

Note: If you want to use the functions to change the style of the page and the page content, call these functions before the page is created by the JavaScript. The styling is added in a style block and cannot allways be dynamically changed by using the functions.

 

  • 1. a. b. True or false.
  • 2. True or false, 1 or 0.
  • 3. a. b. c. d. The URL of the image to use as a background.
  • 4. The background colour to use, such as #ffffff.