Any way to tell what field last had focus?

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.
 
B

bruce barker

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)
 

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

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top