Using a submit button to validate form fields : EmailValidator « Data Model « Flex






Using a submit button to validate form fields

Using a submit button to validate form fields
    
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:StringValidator source="{username}" 
                        property="text"
                        minLength="6" 
                        trigger="{submitButton}" 
                        triggerEvent="click" />
    <mx:EmailValidator source="{email}" 
                       property="text"
                       trigger="{submitButton}" 
                       triggerEvent="click" />
    <mx:Text text="Email:" />
    <mx:TextInput id="email" />
    <mx:Text text="Enter your username:" />
    <mx:TextInput id="username" />
    <mx:Button label="Submit" id="submitButton" />
</mx:Application>

   
    
    
    
  








Related examples in the same category

1.Using ActionScript to validate EmailUsing ActionScript to validate Email
2.Email address validationEmail address validation
3.Use EmailValidator to validate email cell editorUse EmailValidator to validate email cell editor
4.Data source for EmailValidatorData source for EmailValidator
5.Using the EmailValidator classUsing the EmailValidator class
6.Using EmailValidatorUsing EmailValidator
7.Validate Email With ActionScriptValidate Email With ActionScript
8.Use new line character to error messageUse new line character to error message