HotDocs JavaScript API
    Preparing search index...

    Interface IInterviewOptions

    interface IInterviewOptions {
        AnsSumBulletAnswers?: boolean;
        AnsSumBulletPrompts?: boolean;
        AnsSumIndentAnswers?: boolean;
        AnsSumIndentPrompts?: boolean;
        AnsSumNumCols?: 1 | 2;
        AnsSumPromptWidth?: number;
        AnsSumShowBorders?: boolean;
        Container?: string;
        DisableAnswerSummary?: boolean;
        DisableOnSubmit?: boolean;
        FinishWarning?: boolean;
        FooterHeight?: number;
        Height?: number | "auto";
        InfoPaneWidth?: number;
        LanguageModule?: { [key: string]: string };
        LeaveWarning?: boolean;
        LoadingTimeout?: number;
        Locale?: string;
        Logger?: LoggingCallback;
        OnInit?: () => void;
        OutlineWidth?: number;
        RequiredAsterisk?: boolean;
        SplashScreen?: { Duration?: number; Image?: string; Text?: string };
        SuppressLoader?: boolean;
        TemplateTitleOverride?: string;
        Theme?: string;
        Width?: string | number;
    }
    Index

    Properties

    AnsSumBulletAnswers?: boolean

    Controls whether the answer summary displays a bullet next to the answers; default is false This only has an effect if [[AnsSumNumCols]] is set to 1

    AnsSumBulletPrompts?: boolean

    Controls whether the answer summary displays a bullet next to the prompts; default is false This only has an effect if [[AnsSumNumCols]] is set to 1

    AnsSumIndentAnswers?: boolean

    Controls whether the answer summary indents the answers; default is true This only has an effect if [[AnsSumNumCols]] is set to 1

    AnsSumIndentPrompts?: boolean

    Controls whether the answer summary indents the prompts; default is true This only has an effect if [[AnsSumNumCols]] is set to 1

    AnsSumNumCols?: 1 | 2

    Controls whether the answer summary is displayed in an indented layout or in a colum layout.

    • 1 : Displays an indented layout
    • 2 : Displays a column layout The default is 2 (column layout)
    AnsSumPromptWidth?: number

    Defines the width as a percentage that the prompt will use in the answer summary; default is 30. Only values between 10 (inclusive) and 90 (inclusive) are permitted. Values outside of this range will be set to 30.

    AnsSumShowBorders?: boolean

    Controls whether the answer summary draws borders around the various elements in the summary; default is false This only has an effect if [[AnsSumNumCols]] is set to 2

    Container?: string

    The ID of a DIV element in which the interview will be displayed; default is hdMainDiv.

    DisableAnswerSummary?: boolean

    Removes the answer summary from the interview's toolbar; default is false

    DisableOnSubmit?: boolean

    This determines whether or not buttons, input fields, and other controls on the interview are disabled (by overlaying them with a translucent HTML DIV) when answers are being submitted to the server. The default is true.

    We recommend leaving the default behavior in place; disabling the interview prevents unintentional clicks while the form data is transferred and the server is responding to the request. However, one scenario where you may wish to set DisableOnSubmit to false (thus suppressing the default behavior) might be where you are registering a handler for the PreHDSubmit event, and you are already taking some other action in that handler that effectively disables form controls. For example, if you are already overlaying your own div atop the interview (in response to PreHDSubmit), then the DIV HotDocs uses to disable the form becomes redundant.

    FinishWarning?: boolean

    When set to false, suppresses the browser interview's default behavior of warning the user before he or she submits an interview accidentally or which may be in an incomplete state; default is true. Users are normally warned before submitting answers in two (overlapping) circumstances:

    1. If the user attempts to finish the interview with unanswered questions (i.e. questions for which no answer has been provided, but which were not designated as optional by the template author), or
    2. If the user is at the last dialog of an interview, and clicks the Next button rather than the Finish button. If either or both of these conditions are true, the user is shown an appropriate warning message and is asked to confirm the action.
    FooterHeight?: number

    The number of pixels to reserve below the interview when the Height option is set to auto and the actual height of the interview's HTML DIV is being calculated; default is 0.

    Height?: number | "auto"

    The requested height of the interview; default is auto. In cases where an interview contains more questions than can fit on the screen at one time, the interview will typically show its own vertical scroll bar. It can be awkward if the containing web page displays a scroll bar as well. A value of auto will cause the height of the HTML DIV containing the interview to scale relative to the current window size. The actual height will reflect the height of the browswer window's client area MINUS the vertical offset of the interview within the window. The net effect is that specifying auto for the height will cause the interview to take up all available vertical space in the window. Vertical space can be reserved at the bottom of the window (to leave room for additional page elements, for example) using the FooterHeight property. If you specify a value besides auto, that value must be an absolute number of pixels.

    InfoPaneWidth?: number

    Initial width (in pixels) of the resource pane; default is 100.

    LanguageModule?: { [key: string]: string }

    An object containing one or more language modules to load. The name of each item in array is the name of the language module (e.g., "en-GB") and the value is the URL from which the JavaScript file containing the language module can be downloaded. A browser interview can be associated with only a single locale, so in most instances only a single JavaScript file will need to be loaded. This is especially true since a single JavaScript file can contain multiple language modules. However, since specific language modules can inherit behavior from more general language modules; therefore a situation could arise where you need to load multiple JavaScript files to ensure the desired behavior. An example of how a language module is specified is:

    let interviewOptions = {
    Locale: "en-US-mycompany",
    LanguageModule: { "en-US-mycompany": "http://mycompany.com/hdrelated/hdlang-customized.js" }
    };

    In the above example, the "en" and "en-US" language modules are defined internally by HotDocs. A set of 3rd party language strings is being loaded in order to override some of the built-in interview language.

    In the following, more complex example, a generic German language module is being loaded from one URL, a module with modifications specific to the Swiss locale is loaded from a different URL, and 3rd-party-specific language string customizations are loaded from a third. This might be a stretch.

    let interviewOptions = {
    Locale: "de-CH-mycompany",
    LanguageModule: {
    "de": "http://url/to/hdlang-de.js",
    "de-CH": "http://url/to/hdlang-des.js",
    "de-CH-mycompany": "http://url/to/hdlang-des-mycompany.js"
    }
    };
    LeaveWarning?: boolean

    Specifies whether the end user will be warned if they try to close or navigate away from the interview page without submitting their answers to the host application. The interview accomplishes this warning by registering for the "before unload" event in the browser. If this behavior is not appropriate for your host application, set this to false.

    LoadingTimeout?: number

    The number of seconds to wait for interview definitions to load; default is 30. If you set this to a number less than or equal to 0, the interview will wait indefinitely.

    Locale?: string

    The name of the browser language module that will be loaded and used by HotDocs when presenting this interview. The name is formed by a two-letter language code (from ISO 639-1), optionally followed by a two-letter region code(from ISO 3166); default is en-US (US English). Language modules dictate date and number formatting, calendars, all built-in user interface text, etc. To learn more about interview locales and how to add support for locales other than US English, see "Browser Language Module" in the help file.

    By providing a logging callback, the host application will be notified of any logging events raised by the interview. This allows the host application to track runtime errors.

    OnInit?: () => void

    A function to call before HotDocs builds the interview to perform any necessary interview pre-processing or customization, such as adding buttons to the interview toolbar or registering interview event handlers. For example:

    let interviewOptions = {
    OnInit: function() {
    HD$.RegisterHandler("OnHDNavigated", function (eventArgs) { console.log(eventArgs.DialogName });
    }
    };
    OutlineWidth?: number

    Initial width (in pixels) for the interview outline; default is 200.

    RequiredAsterisk?: boolean

    Indicates whether an asterisk will be appended to the prompt of "required" variables in the interview; default is false. Prompts for required variables normally highlighted in an alternate color(as dicatated by the interview stylesheet) until they have been answered, but this option causes asterisks to be shown as well (even after the variables have been answered).

    SplashScreen?: { Duration?: number; Image?: string; Text?: string }

    Displays an image and/or text while the interview is loading; default is no splash screen. When specified, the splash screen is an object with three optional properties:

    • Duration:

    Type Declaration

    • OptionalDuration?: number

      A time in seconds that indicates how long the splash screen will be visible. The default is 3.

    • OptionalImage?: string

      A URL to an image that is shown on the splash screen

    • OptionalText?: string

      Shown at the bottom of the splash screen (below the image if one is specified)

    SuppressLoader?: boolean

    Determines whether or not the loading progress indicator is displayed while the interview loads; default is false.

    TemplateTitleOverride?: string
    Theme?: string
    Width?: string | number

    The requested width of the interview; default is auto. A value of auto will cause the HTML DIV containing the interview to use the full width available to it--typically the width of the containing element in the HTML DOM. If you specify a value besides auto, that value should be either a number of pixels (with no designated unit) or a number followed immediately by a CSS-compatible unit designator.