A fragment is a reusable part of a form. A fragment is stored in the LiveCycle ES repository as a separate XDP file that can be inserted into multiple form designs. For example, a fragment could include an address block or legal text.
Using fragments simplifies and speeds up the creation and maintenance of large numbers of forms. When creating a new form, you insert a reference to the required fragment and the fragment appears in the form. The fragment reference contains a subform that points to the physical XDP file.
You can create a fragment in the current file or in a separate file, and you can create multiple fragments in the same file. When you create a fragment in a separate file, a file is generated to store the fragment in the repository.
To create a fragment, you can either select an existing subform or select one or more objects. Subforms also include tables, table rows, header rows, and footer rows. If you select objects that are not in a subform, the objects are wrapped in a subform when the fragment is created.
You can also use a choice subform set that contains multiple fragment references. Choice subform sets control the display of subforms based on the flow of data from a data connection. You use conditional statements to determine which subform from within the set appears in the delivered form.
For example, each subform in a set could include information for a particular state, and the subform that is displayed could be determined based on the state where the form is filed.
A script fragment contains reusable JavaScript functions or values that are stored separately from any particular object, such as a date parser or a web service invocation. These fragments include a single script object that appears as a child of variables in the Hierarchy palette. Fragments cannot be created from scripts that are properties of other objects, such as event scripts like validate, calculate, or initialize.
See also 

Overview of fragments