Warn When Answers Are Incomplete

From HotDocs Wiki

Jump to: navigation, search

There are a variety of ways you can ensure users enter valid answers during an interview. For example, you can use the REQUIRE instruction to prevent users from finishing an interview without answering certain questions. You can also use text patterns so answers such as telephone numbers will be formatted correctly. Although you can prevent users from entering invalid characters if you use a text pattern, it is not possible to force users to enter all required characters. In a telephone number, a user could enter only 7 digits instead of 10, for example.

The following dialog script shows one way you can at least display a message to the user saying that the answer entered is not quite complete. The warning text is an additional text component in the dialog and hidden at the beginning of the script. Then, if the answer contains a space (meaning not all characters have been filled in), the additional text is shown and the user sees that the answer should be corrected.

Examples

Example 1: HotDocs 2005 and earlier

HIDE "{This number must contain nine (9) digits."
REQUIRE Text Var
IF Text Var CONTAINS " "
  SHOW "{This number must contain nine (9) digits."
END IF
Variable Name Description
Text Var Any Text variable with a pattern such as 999999999.

Example 2: HotDocs 2006 and later

HIDE Dialog Element Text
REQUIRE Text Var
IF Text Var CONTAINS " "
  SHOW Dialog Element Text
END IF
Variable Name Description
Dialog Element Text A dialog element that uses the Text style. The display text for this element is: "This number must contain nine (9) digits."
Text Var Any Text variable with a pattern such as 999999999.