Any way to tell what field last had focus?

  • Thread starter Thread starter Mufasa
  • Start date Start date
M

Mufasa

Is there a way to tell what the last field was that had focus? Specifically
I want to have it so that when a person clicks off of a field with
autopostback=true, I want to know the field they went to and set the focus
for that when the page reloads.

TIA - J.
 
create a hidden field lastfocus, and add a onfocus event to each control
that stores its id in the hidden field.

you approach is probably bad. when run locally on your desktop, the
repaint is quick, but remotely it will be seconds between when the
autopostback and re-render (your focus restore) happens.

you should switch to an ajax solution, or design to not use an autopostback.

-- bruce (sqlwork.com)
 
Back
Top