Previous Walkthrough Next Walkthrough


Walkthrough 3:  HDInterviewOptions -- Disabling the Exit Warning

Prerequisites:

  1. A copy of the "EmploymentAgreement" project created in Walkthrough #1.  (Copy the entire project directory structure and work with the copy, leaving the original unmodified for use in other walkthroughs.)

Instructions:

  1. Run the web app, and close the browser without finishing the interview.  Note that a warning appears.



  2. Add a script element and create a new global object named "HDInterviewOptions", with a property named "LeaveWarning" that is set to false.
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EmploymentAgreement.Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
        <script type="text/javascript" src="http://files.hotdocs.ws/download/easyXDM.min.js"></script>
        <script type="text/javascript" src="http://files.hotdocs.ws/download/hotdocs.js"></script>
    </head>
    <body onload="HD$.CreateInterviewFrame('interview', '<%= GetSessionID() %>');">
        <form id="form1" runat="server">
        <h1>Employment Agreement Generator</h1>
        <div id="interview" style="width:100%; height:600px; border:1px solid black">
        
        </div>
        </form>
     
        <script>
            HDInterviewOptions = {
                LeaveWarning: false
            };
        </script>
    </body>
    </html>
  3. Run the web app and again close the browser without finishing the interview.  Note that the warning does not appear.
The HDInterviewOptions global object allows various customizations to be made to the interview. The following properties are supported in HDInterviewOptions, as explained in the HotDocs Cloud Services Embedded JavaScript API documentation:

Previous Walkthrough Next Walkthrough