HD$ Object
The HD$ object exposes methods for creating, communicating with and controlling the IFRAME element in which a HotDocs Embedded interview runs. It encapsulates most of the functionality of the traditional HotDocs JavaScript API, but adds the facility for asynchronous call-backs as is necessary for cross-frame messaging.

JavaScript API: Embedded
Assembly: hotdocs.js Version: 1.0.0.0 (1.0.0.0)
Syntax

JavaScript
Embedded.HD$ = function();

Type.createClass(
        'Embedded.HD$');

The HD$ type exposes the following members.

Methods

  Name Description
Public method AddCustomNavButton
This function adds a button to the interview navigation bar. When a user clicks the button, a JavaScript function is called that performs any action users may need to take while navigating through the interview.
Public methodCode example AddCustomToolbarButton
This function adds a button to the interview toolbar. When a user clicks the button, a JavaScript function is called that performs any action you may wish to make available to users of your host application, such as displaying your host application's help file. (To avoid ambiguity, you should use a full URL for all image file parameters passed to this function.)
Public method AnsGetIter
This function returns a single number value that represents the repeat index (1-based) of the current dialog. This is different than AnsGetRptNdx(function), which is 0-based and returns a complete set of four indexes. As such, AnsGetIter(function) is most useful for non-nested repeats where there is only one index that matters.
Public method AnsGetRptNdx
This function returns the full set of repeat indexes for the current dialog. When using AnsGetVal(String, String, function) and AnsSetVal(String, Object, String, function) with repeated dialogs, this function allows you to get or set the values of variables in the current repetition.
Public method AnsGetVal
This function gets the answer value for a variable. It can also get a single (indexed) value from a repeated answer.
Public method AnsSetVal
This function sets the answer value for a variable. It can also set a single (indexed) value in a repeated answer.
Public method CreateInterviewFrame
Create an iframe element and show the requested interview in it.
Public method GetAllXMLAnswers
This function returns an XML string of answers from the current and all previous interviews. For example, you could use this string to overlay the current and previous interviews' answers on top of an existing answer file, thus updating the answer file with any answers that have been entered during the interviews.
Public method GetAnswer
This function gets the answer value for a variable. It can also get a single (indexed) value from a repeated answer.
Public method GetAnswerIterator
This function returns a single number value that represents the repeat index (1-based) of the current dialog. This is different than AnsGetRptNdx(function), which is 0-based and returns a complete set of four indexes. As such, AnsGetIter(function) is most useful for non-nested repeats where there is only one index that matters.
Public method GetAnswerRepeatIndex
This function returns the full set of repeat indexes for the current dialog. When using AnsGetVal(String, String, function) and AnsSetVal(String, Object, String, function) with repeated dialogs, this function allows you to get or set the values of variables in the current repetition.
Public method GetInterviewBookmark
This function returns a string (up to 70 characters in length) that represents the user's current location in the interview, including the input field that contains the focus. For example, you can call this function before the user leaves the interview, in order to submit a bookmark for the user's current location to the server along with the user's answers. Later, you could use the GotoInterviewBookmark(String, function) method to return the user to the same location in the interview.
Public method GetSnapshot
This function returns a snapshot string you can use to return to a certain point in the interview.
Public method GetXMLAnswers
This function returns an XML string of answers from the current interview. For example, you could use this string to overlay the current interview's answers on top of an existing answer file, thus updating the answer file with any answers that have been entered during the interview.
Public method GotoInterviewBookmark
This function navigates the user to a specific dialog in the interview, and moves the focus to a designated field within that dialog. If the bookmark is invalid, or the location is no longer part of the interview, no navigation takes place.
Public method InvokeButton
This function invokes the 'OnClick' function for one of the toolbar or navigation bar buttons (either built-in or custom), even if the button has been hidden. For example, if you create your own "Finish" button, you may want to hide the built-in "Finish" button but still have your button perform the same action by invoking the hidden "Finish" button.
Public method RegisterHandler
This function is used to register event handlers for various interview events. They can be used for both JavaScript and Silverlight interviews. If necessary the event handler can later be unregistered using the UnregisterHandler(String, function, function) method.
Public methodCode example ScreenRefresh
This function refreshes the screen to update answers in the variable fields that have changed.
Public method SetAnswer
This function sets the answer value for a variable. It can also set a single (indexed) value in a repeated answer.
Public methodCode example SetButtonVisibility
This function lets callers hide individual buttons on the toolbar or navigation bar. It can also be used to hide the entire toolbar or navigation bar.
Public method SetToolbarButtonImage
This function lets callers specify alternate images for built-in toolbar buttons. It should be called before the toolbar is rendered for the first time, such as in your HDInterviewOptions.OnInit method.
Public method UnregisterHandler
This function is used to unregister an event handler for an interview event that was registered using the RegisterHandler(String, function, function) method.
Top
Properties

  Name Description
Public field CloudServicesAddress
The URL of the installation of HotDocs Cloud Services to which this instance is communicating.
Top
See Also

Reference