Considerations when creating JavaScript for Guides

When you create a Guide based on a form design, you should consider the following:

  • Scripting on master pages is ignored.

    Guides do not use page-based layout. Instead, Guides use the concept of sections and panels which the Guide author creates in Workbench. Therefore, no scripting on master pages defined in Designer is preserved when the Guide is rendered.

  • Field level dependencies are ignored, with the exception of the rawValue property.

    Field data values, controlled using the rawValue property, that are dependent on the values of another field or fields will continue to operate as expected. All other field properties that are dependent on the values of other fields will not persist on a Guide. For example, if the color of a field’s border is set to change when the border color of another field changes, this behavior will not persist on a Guide.

  • Guides cannot correctly use the this JavaScript shortcut reference as part of a script object.

    For example, the following function will not evaluate correctly on a Guide.

    function addToValue( nNumber ) 
        this.rawValue = this.rawValue + nNumber; 

    In this case, you must modify the function to either explicitly pass the this shortcut reference as a variable, or pass a variable that represents a pointer to the current object as a formal parameter. For example:

    addToValue( this, 10 ); 
    - or - 
    function addToValue( obj, nNumber) 
        obj.rawValue = obj.rawValue + nNumber; 
  • Guides return the value of an empty field as "" (empty string), while Acrobat and Adobe Reader return NULL. In situations where a script may execute in both Acrobat/Adobe Reader and Flash Player, you should make sure you test for both values using conditional statements.

    For example, the following script evaluates to True (0) for both Guides and PDF forms, provided TextField1 does not contain a value:

    if ((TextField1.rawValue == NULL) || (TextField1.rawValue == ""))  
        return True; 
  • Guides do not support multiple instances of a message box to display synchronously. This behavior is different from Acrobat and Adobe Reader which support the display of multiple instances. The result is that, on Guides, only the first message box in a sequence displays to the user.

    For example, if the following script is placed on the exit event of a text field:"Read this first.");"Then read this.");

    On a runtime Guide, when a user exits the text field, only the first message displays.

// Ethnio survey code removed