Microsoft Office InfoPath 2003 Kick Start

 <  Day Day Up  >  

The InfoPath text box control is similar to a typical input element in an HTML form ”it allows you to enter short pieces of text, such as a user name or a single line of an address.

If you have a predefined data source and the option to automatically create friendly names is set, dragging a field from the data source to the form area will insert a friendly label with the text box following on the same line.

Placeholder Text and ToolTips

The text box can be viewed with sample data or without (the default). To add sample text, select the View menu and click Sample Data. Figure 4.3 shows the SimpleHR2 form template with sample data inserted into the two text boxes.

Figure 4.3. Text box controls with sample data.

As you can see in Figure 4.3, the default sample data provided by InfoPath is not very informative. You can add more meaningful placeholder information by right-clicking on the text box control in design mode, selecting Text Box Properties, selecting the Display tab, and typing the desired text into the Placeholder box.

Modifying Text Box Properties

If you add some lengthy placeholder text, you might want to make the text box control wider than the default 130 pixels. This can be changed on the Size tab of the Text Box Properties window.

A further customization is the addition of a ToolTip for individual text boxes. This can be added on the Advanced tab of the Text Box Properties window.

Figure 4.4 shows the SimpleHR2 form template in preview mode after placeholder text has been added. The text box controls have had their width increased to display all the placeholder text, and ToolTips have been added for each text box control.

Figure 4.4. Preview mode of SimpleHR2 showing placeholder text.

If you select Sample Data on the View menu, it takes precedence over the placeholder data that you enter for each text box on the Display tab of the Text Box Properties window.

Text Wrapping

You can also customize text box controls so that they allow or disallow vertical wrapping of text. Wrapping is turned off by default. To switch wrapping on for a text box control, select the Display tab of the Text Box Properties window and check the Wrap Text check box (see Figure 4.5).

Figure 4.5. Allowing the wrapping of text in a text box.

When wrapping is enabled, the user can enter long text into a text box and cause vertical wrapping. Figure 4.6 shows horizontal scrolling in the First Name text box and vertical text wrapping in the Last Name text box in SimpleHR3.xsn .

Figure 4.6. Text wrapping in the First Name text box.

INTERMITTENT FALSE ALARMS FOR VALIDATION

The first release of InfoPath 2003 seems to have an intermittent bug that causes some text boxes to be outlined in red dashes (usually a sign of a validation problem) when you switch windows with a form in preview mode.

 <  Day Day Up  >  

Категории