By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,761 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,761 IT Pros & Developers. It's quick & easy.

Any way to tell what field last had focus?

P: n/a
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.
Oct 4 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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)

Mufasa wrote:
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.

Oct 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.