Spry Framework for Creating Ajax Applications
Recall that Ajax applications separate client-side user interaction and server commu-nication and run them in parallel, making the delays of server-side processing more trans-parent to the user. Consider the form example that you built in Fig. 20.29. None of the data entered into the form is transmitted to the server until the user clicks the Submit button. At that time, any errors in the form are sent back to the user for correction. With Ajax and the Spry framework, text field input is validated on the client side. When the page loads, the files that provide the validation are loaded directly into the page, so you can check for errors in any given field as soon as the user moves to the next field in the form.
Now, let’s rebuild the form in Fig. 20.29 using Spry controls. First, insert Spry Validation Text Fields next to the Name and E-mail Address labels.
Select the blue Spry box connected to the text field you created next to the E-mail Address label. In the Property Inspector, set the Type: to Email Address. Make sure that the Change checkbox is selected. This means that a valid e-mail address must be in the field and if any changes are made to the address, the client will display a message prompting the user to make a change before continuing (Fig. 20.33).
Our application detects an error when validating the information in the e-mail address text field. As soon as we try to move to the next field, the application displays the error Invalid format to let us know that we must correct the information that we originally typed into that field.
the latest version of the framework, visit labs.adobe.com/technologies/spry/.
Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.