Google


   


You are here: CodeIdol.com > Flash > Macromedia Flash® ActionScript: Training from the Source > Lesson12.Data Validation > The Logic Behind Validating Data

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

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 the following (U.S.) phone number: 555-34567. Chances are you quickly recognized the phone number to be invalid. How? Your brain analyzed the phone number and noted that it contained eight digits. After comparing this fact to the rule that defines valid local phone numbers as those that include seven digits, your brain made a determination of true (the number was valid) or false (it was invalid). If you determine that the number is valid, you can place the phone call. If the number is invalid, however, your brain will log an error messagesomething similar to "That number is wrong. I need to get the correct number and then try to call."

If we were to break down the validation process, it would look similar to the following:

1.
Define criteria for valid data.

2.
Analyze submitted data.

3.
Compare this data against defined criteria.

4.
Continue if data is valid; determine and note error if data is invalid; resolve and then try again.

In Macromedia ActionScript, this process of analyzing informationcomparing it to a set of rules and then determining the data's validityis known as a validation routine. Just as your brain analyzes data instantaneously, an ActionScript validation routine takes a split second to complete.

You usually need to validate data within a Flash application whenever you require the user to enter information into an input text fieldfor example, on forms (name, address, phone number, and so on) and quizzes (to verify answers) and in e-commerce shopping carts (quantities, sizes, colors, and so on).


SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

You are here: CodeIdol.com > Flash > Macromedia Flash® ActionScript: Training from the Source > Lesson12.Data Validation > The Logic Behind Validating Data


ADBRITE ads links
   
Related tags







Popular Categories
Unix books and guides

AJAX popular information
C# language guides
Windows books and cookbooks

.......








Business Key Top Sites

be number one
rate your site




    С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.

    Русский Polski Francais Deutsch
    support sitemap terms

© CodeIdol Labs, 2007 - 2009