2 Replies Latest reply on Jul 20, 2007 11:11 AM by san_g

    Basic question

    san_g
      Hi Guys,

      I m trying to learn Flex 2.i seen some codes from adobe.i didnt understand where the validation logic placed .

      the following code:
      <!-- Simple example to demonstrate SocialSecurityValidator. -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

      <mx:Script>
      import mx.controls.Alert;
      </mx:Script>

      <mx:SocialSecurityValidator source="{ssn}" property="text"
      trigger="{myButton}" triggerEvent="click"
      valid="Alert.show('Validation Succeeded!');"/>

      <mx:Panel title="Social Security Validator Panel" width="75%" height="75%"
      paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

      <mx:Form>
      <mx:FormItem label="Enter Social Security number: ">
      <mx:TextInput id="ssn" width="100%"/>
      </mx:FormItem>

      <mx:FormItem >
      <mx:Button id="myButton" label="Validate" />
      </mx:FormItem>
      </mx:Form>
      </mx:Panel>
      </mx:Application>

      when i run this code it runs but i m unable to understand where the validation part is written to validate SSN no..

      Thanks
      San
        • 1. Re: Basic question
          Level 7
          <mx:SocialSecurityValidator source="{ssn}" property="text"
          trigger="{myButton}" triggerEvent="click"
          valid="Alert.show('Validation Succeeded!');"/>

          SocialSecurityValidator is a built in validator that comes with Flex.
          The documentation describes how to build custom validators if that is
          needed.

          • 2. Re: Basic question
            san_g Level 1
            Thanks..i checked Flex Documenation .i didnt find SSN Validator.i seen in mx.controls.alert,i will check now again