WeCodeThings Library
Library of code bits
Glossary    Contact Us
Need a web designer? visit WeCodeThings.Com for more details
Search  
   
Browse by Category

WeCodeThings Library .: Flex .: Flex 3 Add Custom Error using the errorString to a TextBox or Any Object using Object.errorString Flex 3



Flex 3 Add Custom Error using the errorString to a TextBox or Any Object using Object.errorString Flex 3

You can add a custom error to any element or object by using the id of the object followed by .errorString

private function startinsert(evt:Event):void

            {

                  if (txtFirstName.text != "" && txtLastName.text != "")

                  {

                        mycfc.insertrecord(txtFirstName.text,txtLastName.text); // All statements inside { } are guarded by IF.

                              txtFirstName.errorString = '';

                              txtLastName.errorString = '';

                        }

                        else

                        {

                              Alert.show("check to make sure you have entered both the first AND the last name");

                              txtFirstName.errorString = "First Name Cannot be Left Blank";

                              txtLastName.errorString = "Last Name Cannot be Left Blank";

                        }

            }

 



How helpful was this article to you?

Related Articles

article Flex 3 Create Remote Object Destination ColdFusion using ActionScript And MXML Flex 3
You can read more about Flex 3 and Remote...

(No rating)  4-30-2009    Views: 1159   
article Create Flex 3 Remote Object ColdFusion with Result and Fault Handlers for Flex 3
More about creating a remote object and...

(No rating)  4-28-2009    Views: 1431   
article Add Flex 3 Custom Component to MXML Application within mx:Application tag
Custom components are great for breaking up...

  4-19-2009    Views: 2315   

User Comments

Add Comment
No comments have been posted.




.: Powered by Lore .:Code by WeCodeThings Website Design and Development