Alex's suggestion is probably the right thing to do, but you can also take a 
look at AdvancedForm from flexlib: 
http://flexlib.googlecode.com/svn/trunk/examples/AdvancedForm/AdvancedForm_Sample.swf

-Maciek


-----Original Message-----
From: [email protected] on behalf of smccran
Sent: Thu 4/9/2009 6:21 AM
To: [email protected]
Subject: [flexcoders] Form field clearing
 
Hi all,

I have a standard flex form, and I want to do a simple 'reset' function.

At the moment I would simply set each field value as blank like this:

                private function clear():void
                {
                        nameField.text = "";
                        tel.text = "";
                        email.text = "";
                        
                }

        <mx:Form x="10" y="105" id="jobRequest">
                        <mx:FormItem label="Name" required="true">
                                <mx:TextInput id="nameField"/>
                        </mx:FormItem>
                        <mx:FormItem label="Tel" required="true">
                                <mx:TextInput id="tel"/>
                        </mx:FormItem>
                        <mx:FormItem label="Email" required="true">
                                <mx:TextInput id="email"/>
                        </mx:FormItem>

Is there a better way of doing this? Or a way I can just say jobRequest.reset? 
where 'jobRequest' is the form name.

Thanks
Shaun



Reply via email to