Adding HTML attributes to a field
About this task
There are two places to attach HTML to a field. Use the Field Extra HTML tab on the Field Properties box, or use the HTML Attributes field event to attach HTML formatting attributes to editable fields. By adding HTML code to a text field you can, for example, lengthen that field when it is viewed through a browser.
To add HTML attributes using the Field Properties box:
Procedure
- Double-click the field you want to format.
- Select the Field Extra HTML tab on the Field Properties Box.
-
In the Other HTML tag field, enter the HTML code (without quotes) -- for example, to resize a text field from its default size of 20):
SIZE=75 MAXLENGTH=100
The maxlength value defines the length of the text content a user can enter into the field. Keep the maxlength value approximately 30 percent larger than the size value to enable a user to completely fill a field with text.
- Save the form.
To add HTML attributes using the field's HTML Attributes event:
Procedure
- Click the field you want to format.
- On the Objects tab of the Info List in the Programmer's pane, select the HTML Attributes event for the field.
-
Write the HTML code in quotes in the Script area -- for example, to define a rich text field's properties:
"ROWS=10 COLS=20"
- Save the form.