Method of Form
Syntax
Form.createControlIterator( all = false )
Parameters
Parameter | Description |
---|---|
all | Pass true to get iterator over all form controls, including the ones that do not have a user-assigned ID. New in package 165 |
Description
Returns an iterator over the form's controls. An iterator object returned by createControlIterator has the following two methods:
nextControl() | This method returns the object corresponding to the next form control. If there is no such object (the iteration has reached the end of the list of form controls), the method returns null. |
previousControl() | This method returns the object corresponding to the previous form control. If there is no such object (the iteration is at the beginning of the list of form controls), the method returns null. |
Initially, the iterator points to the beginning of the list of form controls, so that a call to nextControl returns the first form control (previousControl returns null).
Example
The following example uses createControlIterator to add the same form control event listener to all form controls:
See also
Form.getControls, Form.getControlById, NodeIterator (DOM Level 2)