Using text fields

If you want to provide users with a way to enter textual data, add text fields to the form. Text fields enable users to type, select, edit, cut, copy, paste, and delete any of the text inside the field.

Text fields can accept one or more lines of wrapping text and support enhanced formatting capabilities. For example, text fields can display blocks of text in different typefaces and colors. Text can be stored and retrieved as plain text or XHTML. If required, the data in a text field can be formatted and displayed according to predefined patterns.

After you add a text field to the form design, you can edit the caption text and manipulate the object’s properties in the Field, Value, and Binding tabs of the Object palette. You can define these properties:

  • Change the caption for the field. (See Formatting captions.)

  • Set a border style for the field. (See To set the border style.)

  • Define the field as visible, invisible, or hidden. (See Making objects visible, invisible, or hidden.)

  • Specify a locale for the field. (See To specify a locale (language and country or region) for an object.)

  • Specify the comb format for the field.

  • Enable or disable multiple lines of text.

  • Enable or disable the field to be filled with rich-formatted text.

  • Limit the number of characters in the field.

  • Allow page breaks within the content of the field.

  • Keep a text field object with the next object in the document when a page break is introduced.

  • Define the display pattern.

  • Define the edit pattern.

  • Specify an initial value to display.

  • Define a run-time property (for example, insert the page number).

  • Define the validation pattern.

  • Choose whether the field will support plain text or XHTML.

  • Specify a data-binding pattern.

  • Specify a binding method for storing and retrieving bound data.

Text fields support scripting and calculations. If a user is to supply data, you can define whether the input is recommended or required, and you can set up messages to prompt users appropriately. All user input may be validated through scripting.

To allow multiple lines of text in text fields

 In the Object palette, click the Field tab and select Allow Multiple Lines.

To limit the number of characters in text fields

You can limit the number of characters in text fields in one of two ways:

  • You can specify the maximum number of characters allowed.

  • You can specify that Designer use the horizontal length of the text field to determine how many characters to allow.

To specify the number of characters in text fields

  1. In the Object palette, click the Field tab.

  2. Select the Limit Length and, in the Max Chars box, type the maximum number of characters that users will be permitted to enter into the text field.

To limit the number of characters to the width of text fields

 In the Object palette, click the Field tab and select Limit Length to Visible Area.

Allowing page breaks within a text field

The Allow Page Break Within Content option is enabled by default for a text field if the parent subform allows page breaks.

Here are a few things to consider when allowing page breaks within a text field:

  • The Allow Page Break Within Content option is available only if the parent object allows page breaks.

  • The caption text of a text field object will not break between pages when Top or Bottom is selected for the position for the caption in the Field tab of the Object palette.

  • Page breaks are not supported in rotated text field objects.

  • A page break is not allowed when an object that can accept a page break is positioned beside an object that cannot.

To allow page breaks within a text field

 In the Object palette, click the Field tab and select Allow Page Breaks Within Content.

To keep a text field with the next object in the form

The Keep with Next option is enabled for a text field if the parent object allows page breaks and is a flowed container.

The Keep With Next option is disabled for floating fields. Instead, select the Keep With Next option of the text field object referencing the floating field.

 In the Object palette, click the Field tab and select Keep With Next.

To enable the field to be filled with rich-formatted text

By default, a text field is set to display and capture plain text. In this case, if the data value associated with the text field includes text formatting information, the formatting is ignored and the data value is displayed as plain text. You can set it so that any rich-text formatting of the data is preserved.

 In the Object palette, click the Field tab and select Rich Text from the Field Format list.

To define the behavior of the field

  1. In the Object palette, click the Value tab and, in the Type list, select one of these options:

    • To allow users to choose whether to enter data, select User Entered - Optional.

    • To prompt users to enter data and make the field recommended, select User Entered - Recommended and type a custom message in the Empty Message box.

    • To prompt users to enter data and make the field required, select User Entered - Required and type a custom message in the Empty Message box.

    • To make the field read only and display a data value that is calculated and displayed through an attached script, select Calculated - Read Only. Users cannot edit the calculated value.

    • To make the field editable and display a data value that is calculated and displayed through an attached script, select Calculated - User Can Override. Users can edit the value if the calculation script has been written to accept the input. If a user does edit the calculated value, the custom message you specify in the Override Message box appears.

    • To make the field read only and display a data value that is merged or calculated and displayed at run time, select Read Only. Users cannot edit the value.

  2. If the value is recommended or required, type a prompt in the Empty Message box.

  3. If the value will be calculated, attach the calculation script to the object by using the Script Editor.

  4. (Optional) If a calculated value can be overridden, type a message in the Override Message box.

To define custom data-binding properties for text fields

Binding options enable you to build a form that captures data for enterprise infrastructures and/or use an external data source to populate a form at run time. Set data-binding properties in the Binding tab of the Object palette.

  1. Select the text field.

  2. Enable the form to connect to the data source when the form is opened.

  3. Bind the field to its corresponding data node. For information about how to bind objects to a data source, see Binding fields to a data source.

To specify the data format for text fields

Text fields can save data in plain text only or with XHTML text formatting information included as part of the value. The default is plain text. If you change the data format to XHTML, the Rich Text option in the Field Format list in the Field tab of the Object palette is automatically selected.

  1. Select the text field object.

  2. In the Object palette, click the Field tab.

  3. Select the appropriate format from the Field Format list.

To specify the comb format for text fields

Use the comb format when you want to separate characters and numbers added to text fields by border lines.

  1. In the Object palette, click the Field tab.

  2. Select Comb of Characters to includes border lines that separate each character within the text field.

  3. Enter the number of characters that will be separated by border lines within the text field.

// Ethnio survey code removed