<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
*import* mx.controls.Alert;
*private* *function* disp():*void
*
{
Alert.show(*'Validation Succeeded!'*)
}
*// Import necessary classes.
*
*import* mx.controls.Alert;
*import* mx.events.ValidationResultEvent;
*// Event listener for the valid and invalid events.
*
*private* *function* handleValid(eventObj:ValidationResultEvent):*void*
{
*if*(eventObj.type==ValidationResultEvent.VALID)
*// Enable Submit button.
*
regn.enabled = *true*;
*else
*
regn.enabled = *false*;
}
*private* *function* submitForm():*void*
{
Alert.show(*"Form Submitted!"*);
}
]]>
</mx:Script>
<mx:Model id="CheckModel">
<dateInfo>
<DOB>{dob.text}</DOB>
</dateInfo>
</mx:Model>
<mx:Panel id="RegPnl" width="400" height="400" layout="vertical"
horizontalAlign="center" visible="true" styleName="Panel" backgroundAlpha="0"
includeInLayout="true">
<mx:Form>
<mx:FormHeading label="Registration Form" />
<mx:FormItem label=" First Name:">
<mx:TextInput id="fname" />
</mx:FormItem>
<mx:FormItem label=" Last Name:">
<mx:TextInput id="lname" />
</mx:FormItem>
<mx:FormItem label=" Phone :">
<mx:TextInput id="phone" />
</mx:FormItem>
<mx:FormItem label=" E-Mail :">
<mx:TextInput id="email" />
</mx:FormItem>
<mx:FormItem label=" Date :">
<mx:TextInput id="dob" />
</mx:FormItem>
<mx:FormItem label="city" >
<mx:ComboBox >
<mx:dataProvider >
<mx:Array >
<mx:String>Hyderabad</mx:String>
<mx:String>secunderabad</mx:String>
<mx:String>Banglore</mx:String>
<mx:String>Mumbai</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Gender:" direction="horizontal">
<mx:RadioButton label="Male" groupName="gen" selected="true" />
<mx:RadioButton label="Female" groupName="gen" />
</mx:FormItem>
<mx:FormItem label="Marital Status:" direction="horizontal">
<mx:RadioButton label="UnMarried" groupName="mar"/>
<mx:RadioButton label="Married" groupName="mar"/>
</mx:FormItem>
<mx:FormItem label="Fav Music:" direction="horizontal">
<mx:CheckBox label="POP"/>
<mx:CheckBox label="Rock"/>
</mx:FormItem>
</mx:Form>
<mx:Button id="regn" label="Submit" click="submitForm();"/>
</mx:Panel>
<mx:StringValidator id="st" minLength="4" maxLength="15" required="true"
source="{fname}"
property="text" trigger="{fname}" triggerEvent="focusOut" tooShortError="This
string is lessthan 4 " tooLongError="This string is greaterthan 20"
valid="handleValid(event)" invalid="handleValid(event)"/>
<mx:EmailValidator id="ev" source="{email}" property="text" trigger="{email}"
triggerEvent="focusOut" requiredFieldError="Invalid Id"/>
<mx:DateValidator source="{dob}" property="text" allowedFormatChars="/"
trigger="{dob}" triggerEvent="click" valid="Alert.show(*'Validation
Succeeded!'*);"/>
<mx:PhoneNumberValidator source="{phone}" property="text" trigger="{phone}"
triggerEvent="focusOut" valid="Alert.show(*'Validation Succeeded!'*);"/>
<mx:DateFormatter id="df" formatString="DD/MM/YYYY"/>
</mx:Application>
On Fri, Mar 6, 2009 at 12:06 PM, Sankar <[email protected]> wrote:
>
> can you just post the source code? so that we can identify where the
> problem is?
>
> On Mar 5, 6:40 pm, Krishna Chaitanya <[email protected]> wrote:
> > hi all,
> >
> > I am having 2 text boxes , i am having submit button ,suppose
> > any one clicking on the submit button the text box want to show the
> > required feild error
> >
> > but
> >
> > problem is -> it is showing required feild error when i was shifting
> > to another text input or another tab . Plese give me solution on
> > validations ..
> >
> > regards ,
> > krishna
>
> >
>
--
Thanks & Regards,
Jagan Mady's
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---