Use a StringValidator that enables or disables fields based on the
validity of the field in question. I use it all the time for forms
where the submit button is disabled until all required fields are
valid. I think using the focus/blur events are the wrong way to go
about it.
<mx:StringValidator source="{this.zipCodeInput}" property="text"
minLength="1" valid="this.phoneNumberInput.enabled=true;"
invalid="this.phoneNumberInput.enabled=false;" />
Paul
--- In [email protected], "acooleagle" <[EMAIL PROTECTED]> wrote:
>
>
> Thanks for responding - TextInput does not have a property "selectable"
> ...
>
> My intention is that I don't want the user to be able to leave the field
> until a certain value has been entered.
>
>
> --- In [email protected], "superstella_uk" <superstella_uk@>
> wrote:
> >
> > --- In [email protected], "acooleagle" acooleagle@ wrote:
> >
> > Cant you just set the TextField.selectable = false ?
> >
> > >
> > >
> > > Hi all,
> > >
> > > Seems to me that focus events in TextInputs are a bit out of whack.
> > >
> > > The test application below should never allow focus on the
> > > phoneNumberInput field, since its "focusIn" event immediately
> redirects
> > > focus back to the zipcodeInput field.
> > >
> > > However, the zipCodeInput field remains "active" (as indicated by
> the
> > > blue highlight) the phoneNumberInput retains the prompt (!!).
> > >
> > > This is a major problem for us as we would like the focus and the
> prompt
> > > to stay in the active field on occasions where the content of the
> field
> > > is invalid.
> > >
> > > As far as I am concerned this weird focus/prompt behavior is a bug.
> > >
> > > $5 million question now is : does anybody know a workaround?
> > >
> > > Thanks for all feedback,
> > >
> > > = Dirk
> > >
> > >
> > >
> > > <?xml version="1.0"?>
> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
> > >
> > > <mx:Form>
> > > <mx:TextInput id="zipCodeInput" />
> > > <mx:TextInput id="phoneNumberInput"
> > > focusIn="zipCodeInput.setFocus()" />
> > > </mx:Form>
> > >
> > > </mx:Application>
> > >
> >
>