|

 | [back to "Creating field help for your Domino applications (Part 1)"]
Quick steps to adding field help to your applications (sidebar)
If you want to quickly implement field help in your own application -- regardless of whether you've used JavaScript before or even read this article -- simply download the sample database and follow these simple instructions. All you will need to do is copy a few design elements from the sample database into your application, and then paste a formula into each field for which you want help, changing the help text you want displayed. If you want reusable field help, there is an additional form and a few elements that you will need to copy into your application. You will also need to compose the field help documents before you can reference them in your forms. Here are the detailed steps:
1. Copy the following design elements from the sample database into your database:
The "Field Help JavaScript Gold" subform
The "Field Help Gold" form
2. To set up your form for field help, do the following:
Open the RegisterGold form in the sample database, and copy everything between the green horizontal bars onto your form.
Edit the FormTitle field to reflect the title of your form.
Copy everything between the "Pull in help topics" line through the <Computed Subform> formula. Paste it onto your form.
If you are not planning to create any reusable help topics, but want to simply define the help text as needed on a field-by-field basis, delete the FormHelpKey field. Then, skip to Step 5.

3. To set up reusable help, do the following:
Copy the Help Topic form and the Help Topics view to your database.
Compose a help topic for each reusable help item.
-- Make up a help key for each one; you will reference this help key in any fields for which you use that help item.
-- Specify the form or forms on which you want to use that help item.
-- Specify help text, and, if you like, pop-up help text. Use HTML to format the pop-up text (see the Email help topic document in the sample database).
In the screen above, notice the FormHelpKey field. You should have this field on all the forms on which you will use the field help solution. Specify the form name you identified in your help topic. This is what tells your form to pull in the appropriate help keys that are used on it.
4. For each field for which you want to include a reusable help topic, copy and paste the field label and field formulas into your form, as follows:
Copy the phoneLabel field from RegisterGold and paste it over (replacing) your static text. This is for Netscape 4.x browsers, and defines the help text to show when users point to the field label. Change the first two lines of the formula to specify your label text and the help key (in the phone example, both the field label and the help key are called Phone):
LabelText := "Phone:";
HelpKey := "Phone";
Copy the HTMLAttributes formula from the Phone field from RegisterGold and paste it into the HTML Attributes for your field. This is for all browsers except Netscape 4.x, and defines the help text to display when the field gets focus. Change the first line of the formula to specify the same help key you specified above. Also, if you had already defined HTML attributes, such as the size of the field, put them into the third line (otherwise, set that line to NULL). Here is what the formula looks like, with the things you should change shown in bold:
HelpKey := "Phone";
type := "FieldFocus";
otherHTML := "size=20";
@If (
FieldFocusHelp;
OtherHTML + " onFocus=\'FrameHelpKey(\"" + HelpKey + "\", \"" + type + "\")\'";
OtherHTML
)
5. For each field for which you want to define the help text on the fly, copy and paste the field label and field formulas into your form, as follows:
Copy the nameLabel field from RegisterGold and paste it over (replacing) your static text. This is for Netscape 4.x browsers, and defines the help text to show when the users point to the field label. Change the first three lines of the formula to specify your label text, the help text and the pop-up help text. If you don't want pop-up text for a field, set popup equal to NULL. Here is what the first three lines of the formula look like, with the things you should change shown in bold:
LabelText := "Name:";
msg := "Please enter your full name.";
popup := "Please do not use nicknames, but rather your full name as printed on your Lotus Notes Application Development 1 course completion certificate.";
Copy the HTMLAttributes formula from the Name field from RegisterGold and paste it into the HTML Attributes for your field. This is for all browsers except Netscape 4.x, and defines the help text to display when the field gets focus. Change the two lines of the formula to specify the same help text you specified above. Also, if you had already defined HTML attributes, such as the size of the field, put them into the fourth line (otherwise, set that line to NULL). Here is what the formula looks like, with the things you should change shown in bold:
msg := "Please enter your first name.";
popup := "Please do not use nicknames, but rather your full name as printed on your Lotus Notes Application Development 1 course completion certificate.";
type := "FieldFocus";
otherHTML := "size=25";
@If (
FieldFocusHelp;
OtherHTML + " onFocus=\'FrameHelpText(\"" + msg + "\", \"" + popup + "\", \"" + type + "\")\'";
OtherHTML
)
That's it! You should now have working context-sensitive field help for your Web users!
 |
 |  |
|