I am having a problem with a simple text validator. See code below: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Model id="form"> <title>{tiTitle.text}</title> </mx:Model> <mx:StringValidator field="form.title" listener="tiTitle" requiredFieldError="Title must be entered"/> <mx:Form> <mx:FormItem label="Last Name"> <mx:TextInput id="tiLast"/> </mx:FormItem> <mx:FormItem label="Title"> <mx:TextInput id="tiTitle" /> </mx:FormItem> <mx:FormItem label="booboo"> <mx:TextInput id="boobbooo"/> </mx:FormItem> </mx:Form> </mx:Application>
OR: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Model id="form"> <title>{tiTitle.text}</title> </mx:Model> <mx:StringValidator field="form.title" listener="tiTitle" maxLength="6" minLength="3"/> <mx:Form> <mx:FormItem label="Last Name"> <mx:TextInput id="tiLast"/> </mx:FormItem> <mx:FormItem label="Title"> <mx:TextInput id="tiTitle" /> </mx:FormItem> <mx:FormItem label="booboo"> <mx:TextInput id="boobbooo"/> </mx:FormItem> </mx:Form> </mx:Application> If no data is entered into the field, the validator does not trigger. If you enter data, and then delete the data, the validator is triggered. Or, if using the min and max example, if you enter data of the wrong length, the validator is triggered. If you don't enter data at all, the validator does not trigger. How do you use this validator to enforce required text?? ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hofihg1/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123682982/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</a>.</font> --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/