Required field Error message : Validator « Development « Flex






Required field Error message

Required field Error message
          

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Validator id="surnameV"
        required="true" 
        source="{surnameTxt}" 
        property="text"
        requiredFieldError="Your Surname is a required field."/>
            
                
    <mx:Form id="myForm">
        <mx:FormItem label="Insert Surname" required="true">
            <mx:TextInput id="surnameTxt" />
        </mx:FormItem>      
        
    </mx:Form>
    
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.A basic validator for requirementA basic validator for requirement
2.Set source and trigger for validatorSet source and trigger for validator
3.Set source and property for ValidatorSet source and property for Validator
4.Validate model data with ValidatorValidate model data with Validator
5.Declare validators in ActionScriptDeclare validators in ActionScript
6.Assigning a validator to the data modelAssigning a validator to the data model
7.Set validator property to textSet validator property to text
8.Set validator domainSet validator domain
9.Validator returns ValidationResultEventValidator returns ValidationResultEvent
10.Use Validator.validateAll() to invoke validators in an ArrayUse Validator.validateAll() to invoke validators in an Array
11.Assign validator targetAssign validator target
12.MXML validator classesMXML validator classes
13.Call validator validate method in button click action handlerCall validator validate method in button click action handler
14.Use a Button control to invoke a validatorUse a Button control to invoke a validator
15.Use Validators in functionUse Validators in function
16.Run a list of validators defined in an ArrayRun a list of validators defined in an Array
17.Display validation result for a list of validator one by oneDisplay validation result for a list of validator one by one
18.Use a validator along with a data binding to validateUse a validator along with a data binding to validate
19.Create and invoke a validator programmatically in when a user clicks a Button controlCreate and invoke a validator programmatically in when a user clicks a Button control
20.Invoking multiple validators in a functionInvoking multiple validators in a function
21.Explicitly handing validator validation eventsExplicitly handing validator validation events
22.Use Validator defined in MXML and call its validate methodUse Validator defined in MXML and call its validate method
23.Create an array with the validatorsCreate an array with the validators
24.Create and invoke a validator programmatically when a user clicks a Button controlCreate and invoke a validator programmatically when a user clicks a Button control
25.Use method to invoke two validators in response to the click event for the Button controlUse method to invoke two validators in response to the click event for the Button control
26.Use a Button control to invoke a validator, but the application first determines which validator to executeUse a Button control to invoke a validator, but the application first determines which validator to execute
27.Use Email validatorUse Email validator
28.Use Array.filter() filter out disabled validatorUse Array.filter() filter out disabled validator
29.Use button event to trigger a validation eventUse button event to trigger a validation event
30.ActionScript based ValidationActionScript based Validation
31.Form data validationForm data validation
32.Triggering validation by using eventsTriggering validation by using events
33.Triggering validation by using the default eventTriggering validation by using the default event
34.Call validation method in a user methodCall validation method in a user method
35.ValidationResultEvent propertyValidationResultEvent property
36.Changing the color of the validation error messageChanging the color of the validation error message
37.Clearing a validation errorClearing a validation error
38.Validate one component but have validation results apply to a different componentValidate one component but have validation results apply to a different component
39.Explicitly handling component validation eventsExplicitly handling component validation events
40.More than one field date validationMore than one field date validation
41.Data Validation Through EventsData Validation Through Events
42.Data Validation Through ActionScriptData Validation Through ActionScript
43.Triggering validation with EventsTriggering validation with Events
44.Write the performValidation() functionWrite the performValidation() function
45.Perform a validation on a required input fieldPerform a validation on a required input field
46.Reset Value based on validation resultReset Value based on validation result
47.Set errorString to create an error tip without performing any validationSet errorString to create an error tip without performing any validation
48.validate handler and invalid handlervalidate handler and invalid handler
49.Run the validate() method and assign the result to a variableRun the validate() method and assign the result to a variable