focus problem

A

Alex Wagner

We are working on a large C# .NET application and have recently run into
this very strange problem on two different pages created by two separate
developers:

- The pages contain multiple textboxes, dropdowns, etc.
- there is one textbox.focus() javascript on the pages -- inserted via the
page.RegisterStartupScript
- everything works fine and focus works correctly on most of the postbacks
on the page
- EXCEPT: when a postback is triggered by a drop-down onChange event focus
will not happen.
In fact, focus is set to some ominous no-mans-land hidden-kind-of field
since it's IMpossible to manually--by clicking with the mouse (!)--set focus
to any other field. Not drop-down, not textbox! Only two scenarios remedy
that problem:
1. clicking somewhere away from the input fields (like anywhere on
the page) and then back on the desired input
2. or hitting the TAB key -- at which point the field that was
supposed to receive focus in the first place will contain a happily blinking
cursor...

has ANYbody come across a problem like this or has some idea as to what the
problem could be???

Thanks for the help as ANY input is very much appreciated!!
 
G

George

I doubt this is it, but I had a javascript focus problem that was driving me up the wall -- as in, I
could set focus on some controls, but not on others.

After many days of hair pulling, it turned out that the controls that wouldn't receive focus didn't
have a defined "width." I had just dropped them on the page and let the text grow them
automatically. After setting the width property to some value, those controls received focus without
a problem, and I haven't had to deal with it since.

It's a long shot, but thought I'd throw it out there.

George
 
A

Alex Wagner

I sure appreciate the input but--as you already predicted--it didn't fix our
problem.

Any other ideas?


George said:
I doubt this is it, but I had a javascript focus problem that was driving me up the wall -- as in, I
could set focus on some controls, but not on others.

After many days of hair pulling, it turned out that the controls that wouldn't receive focus didn't
have a defined "width." I had just dropped them on the page and let the text grow them
automatically. After setting the width property to some value, those
controls received focus without
 
A

Alex Wagner

Does anybody else have any ideas?

Alex Wagner said:
I sure appreciate the input but--as you already predicted--it didn't fix our
problem.

Any other ideas?


driving
me up the wall -- as in, I
controls received focus without anywhere what
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top