ADBRITE ads links
You are here: CodeIdol.com > Flash > Macromedia Flash® ActionScript: Training from the Source > Lesson12.Data Validation
Macromedia Flash® ActionScript: Training from the Source
| Lesson 12. Data Validation
Many applications collect information from usersphone numbers, email addresses, and so onfor later use, or to send to a database where the data can be stored and retrieved as needed. However, if an application trusted us...
|
|
| What You Will Learn
In this lesson, you will:
Learn why validation is importantDefine validation requirementsSet up a mechanism to handle errors found in the validation processCreate functions for validating strings, sequences, and numbersSend da...
|
|
| Approximate Time
This lesson takes approximately one and one half hours to complete.
...
|
|
| Lesson Files
Media Files:
None
Starting Files:
Lesson12/Start/validate1.fla
Completed Project:
Lesson12/Completed/validate7.fla
...
|
|
| The Logic Behind Validating Data
We validate things every dayfrom words in a sentence (to make sure they make sense) to change received from purchases. The concept of validation is a natural and easy one for us to understand. For example, examine ...
|
|
| Using Validation Routines
You can think of a validation routine as a mini-scripting machine within your project that validates the data it receives and then acts accordingly, based on whether that data is valid or invalid. As such, most validation...
|
|
| Handling Errors
Different projects require varying solutions for handling the errors that the validation process brings to light. In some cases, you may want to provide a graphical indicator such as a red X next to the field containing the error; ...
|
|
| Validating Strings
As mentioned earlier in this lesson, when validating different types of data (names, phone numbers, email addresses, and so on) it's best to break the process into specialized functions or validation routines. We will begin that...
|
|
| Validating Sequences
A sequence is a string of characters (letters, numbers, and special characters) placed in a specific order or formatted in a special way. Following are some sample sequences:
Telephone number (xxx-xxxx)Credit card number (xxx...
|
|
| Validating Against a List of Choices
There are times when a value entered into a form must match one of several choices. For example, if a form asks the user to enter a specific colorred, yellow, or blueand the user accidentally enters rod or yull...
|
|
| Validating Numbers
Validating numbers is not much different from validating strings, which we've already discussed.
In this exercise, we'll create one last validation function to validate the data entered into the zip_ti instance. To be a valid f...
|
|
| Processing Validated Data
The last task for our application is to send all the validated data to a server for processing. We'll use a LoadVars instance to accomplish this goal.
1. Open validate6.fla.
We'll continue building on the ...
|
|
| What You Have Learned
In this lesson, you have:
Learned why validation is important (page 291)Defined validation requirements and used them to create conditional statements (pages 292294)Set up a mechanism to handle errors detected in the validat...
|
|
You are here: CodeIdol.com > Flash > Macromedia Flash® ActionScript: Training from the Source > Lesson12.Data Validation
|
|
Related tags
Popular Categories
Unix books and guides
AJAX popular information
C# language guides
Windows books and cookbooks
.......
|
|