focus() doesn't seem to work in IE-6 
Author Message
 focus() doesn't seem to work in IE-6

I'm using jscript verification for a table full of text
boxes. When a user enters an invalid value, s/he gets the
appropriate alert, but the focus stays where it was when
the user moved off of it. I'm passing the text box element
to the verification routine, and all the attributes
like .name, .value, etc. work just fine. .focus() alone
fails.

Is this a problem with IE? Has anyone else had it? Is
there a fix or a workaround (I can't find one), and how do
I get MS involved in this if there isn't?

Thanks for your help!



Sun, 10 Jul 2005 07:30:07 GMT  
 focus() doesn't seem to work in IE-6


Quote:
> I'm using jscript verification for a table full of text
> boxes. When a user enters an invalid value, s/he gets the
> appropriate alert, but the focus stays where it was when
> the user moved off of it. I'm passing the text box element
> to the verification routine, and all the attributes
> like .name, .value, etc. work just fine. .focus() alone
> fails.

> Is this a problem with IE? Has anyone else had it? Is
> there a fix or a workaround (I can't find one), and how do
> I get MS involved in this if there isn't?

> Thanks for your help!

Without seeing all the code, I would guess you are calling the validation
function on with the "onchange" event handler and you are losing focus by
hitting the TAB key?

If so, what is happening is that the onchange event is being called before
the field loses focus (i.e., before the onblur event), your code runs, sets
the focus back to the field and exits, then IE finishes the job off by
moving focus from the field to the next item in the tab order.



Sun, 10 Jul 2005 18:19:38 GMT  
 focus() doesn't seem to work in IE-6
ack... and the solution is to use "onblur" instead of "onchange"


Quote:


> > I'm using jscript verification for a table full of text
> > boxes. When a user enters an invalid value, s/he gets the
> > appropriate alert, but the focus stays where it was when
> > the user moved off of it. I'm passing the text box element
> > to the verification routine, and all the attributes
> > like .name, .value, etc. work just fine. .focus() alone
> > fails.

> > Is this a problem with IE? Has anyone else had it? Is
> > there a fix or a workaround (I can't find one), and how do
> > I get MS involved in this if there isn't?

> > Thanks for your help!

> Without seeing all the code, I would guess you are calling the validation
> function on with the "onchange" event handler and you are losing focus by
> hitting the TAB key?

> If so, what is happening is that the onchange event is being called before
> the field loses focus (i.e., before the onblur event), your code runs,
sets
> the focus back to the field and exits, then IE finishes the job off by
> moving focus from the field to the next item in the tab order.



Sun, 10 Jul 2005 19:52:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. define a measurement doesn't seem to work

2. location.replace doesn't seem to work

3. comparisons between decimal and hex values doesn't seem to work

4. response.expires doesn't seem to work!

5. My Script...Doesn't Seem to Work

6. CDONTS.DLL doesn't seem to work.

7. STMAdmin.dll to query NT Log doesn't seem to work properly

8. Preloading Images in IE 5.0 doesn't work

9. doesn't work in IE

10. JavaScript doesn't work properly in IE

11. javascript doesn't work in IE

12. javascript doesn't work for IE 4

 

 
Powered by phpBB® Forum Software