Creating Forms > Using behaviors with forms |
You can attach behaviors to forms and form objects by using any of the behaviors that appear in the Behaviors panel when the form or form object is selected. The Validate Form and Set Text of Text Field behaviors are available only if a text field has been inserted into the document. When attaching the Validate Form behavior to a form object, you must specify which text field is to be validated. For example, if you attach Validate Form to the Submit button, you might specify a text field created for "Name" to check that the user entered text in the Name field.
When applying behaviors, you need to make sure that every form object in your document (and every other object) has a unique name. If you use the same name for two different objects, behaviors may not work properlyeven if the objects are in different forms.
The two form-specific behaviors are explained below. For information on other behaviors, see Behaviors overview.
Validate Form checks the contents of specified text fields to ensure that the user has entered the correct type of data. See Validate Form.
Set Text of Text Field replaces the content of a specified text field with the content you specify. See Set Text of Text Field.