Figure 11-18. Data provider for ComboBox set
Working with validation
Now that the first step of our form is complete, we can go on to Step 2 ??“ Contact Info. To start placing
the content for the second step, click on the Step 2 ??“ Contact Info label on the Accordion. This will hide
the content area of the first step and open the content area of the second step (Figure 11-19).
Figure 11-19. Pane 2 selected
229
CREATING FORMS: THE ???WILL FLEX FOR FOOD??? REGISTRATION PAGE
Here we will again be placing TextInput components, which automatically get placed into a FormItem
component, but this time we will be taking the extra step of making sure that the text the user enters
looks correct. The Form component was added into the content area of the Accordion when the
Accordion panel was created. Form should have been the setting at that point.
24. Add a TextInput component. Type a FormItem label as well as a label for users to enter their e-mail
address. Make sure that you give the TextInput an ID of email (Figure 11-20).
Figure 11-20. Email TextInput
Although we do not know what e-mail address is going to be placed into this field, we do know that
there are certain rules about the format of an e-mail address. Flex makes it fairly easy to check that
the format is correct and let users know if they??™ve made an error. This is done through a validator, in
this case an e-mail validator.
A validator is an MXML tag that checks the format of a certain piece of information.
Pages:
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163