[Javascript] onBlur & onFocus together

Iztok Polanic iztok.polanic at amis.net
Fri Feb 18 08:26:45 CST 2005


Hi!

If I delete onFocus handler it doesn't help! I think the problem lies in
setTimeout() which calls it self again and again etc.

--
Bye,

Iztok


Navajanje "Hakan M (Backbase)" <hakan at backbase.com>:

> Why do you need the onFocus handler?
>
> Regards,
> H
>
> Iztok Polanic wrote:
> > Hi!
> >
> > OK...it's like that. When a user types in a username, I'm using onBlur
> > and php template (remote loading) to check if this username already
> > exists. Because script needs sometime to be processed, I 'm using
> > setTimeout to delay execution of that script.
> >
> > <form name="user" onBlur="loadVar(this.value);
> > setTimeout('checkUser()',1000)" onFocus="this.select()">
> >
> > But now I'm trapped in a continous loop :(
> >
> >
> > Bye,
> >
> > Iztok
> >
> > Allard Schripsema wrote:
> >
> >> TESTED IT AND WORKED,
> >> We need to see the rest of SOMETHING(), i guess.
> >>
> >> <html>
> >> <head>
> >> <title>Untitled</title>
> >> </head>
> >> <script>
> >> function something(){
> >> if (document.forms['form'].elements['user'].value!="1")
> >>     document.forms['form'].elements['user'].focus();
> >> }
> >> </script>
> >> <body>
> >> <form name="form">
> >> <input type="text" name="user" onBlur="something()"
> >> onFocus="this.select()">
> >> </form>
> >> </body>
> >> </html>
> >>
> >> -----Original Message-----
> >> From: javascript-bounces at LaTech.edu
> >> [mailto:javascript-bounces at LaTech.edu]On Behalf Of Paul McGuire
> >> Sent: Friday, February 18, 2005 10:37 AM
> >> To: '[JavaScript List]'
> >> Subject: RE: [Javascript] onBlur & onFocus together
> >>
> >>
> >> Need to see code then
> >>
> >> -----Original Message-----
> >> From: javascript-bounces at LaTech.edu
> >> [mailto:javascript-bounces at LaTech.edu]
> >> On Behalf Of Iztok Polanic
> >> Sent: 18 February 2005 12:31
> >> To: [JavaScript List]
> >> Subject: Re: [Javascript] onBlur & onFocus together
> >>
> >> Hi!
> >>
> >> Nope!
> >>
> >> Bye,
> >>
> >> Iztok
> >>
> >> Paul McGuire wrote:
> >>
> >>> Are you calling the function from more than one text field?
> >>>
> >>> Paul
> >>>
> >>> -----Original Message-----
> >>> From: javascript-bounces at LaTech.edu
> >>> [mailto:javascript-bounces at LaTech.edu]
> >>> On Behalf Of Iztok Polanic
> >>> Sent: 18 February 2005 12:15
> >>> To: [JavaScript List]
> >>> Subject: [Javascript] onBlur & onFocus together
> >>>
> >>> Hi!
> >>>
> >>> I'm building a web form. I'm using a onBlur event to check if the string
> >>> is correct. Otherwise it should go back to that field (via onFocus).
> >>> Strange thing is, that I'm trapped in a loop. Why is this happening and
> >>> how to solve this?
> >>>
> >>
> >> _______________________________________________
> >> Javascript mailing list
> >> Javascript at LaTech.edu
> >> https://lists.LaTech.edu/mailman/listinfo/javascript
> >>
> >> _______________________________________________
> >> Javascript mailing list
> >> Javascript at LaTech.edu
> >> https://lists.LaTech.edu/mailman/listinfo/javascript
> >>
> >>
> >> _______________________________________________
> >> Javascript mailing list
> >> Javascript at LaTech.edu
> >> https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> >
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list