473,804 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any way to tell what field last had focus?

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=tr ue, 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
1 1533
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=tr ue, 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
28145
by: 'bonehead | last post by:
Greetings, I'm still something of a newbie to html/php/mysql. I have a php/html form with several fields of type "input". If the user enters improper data in a particular field and clicks the Submit button, the php script has to trap it and return a javascript error message box with an OK button. That part I've already got down. But, you know how in Visual Basic you can set the focus on the offending
303
17802
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
4
5486
by: M Wells | last post by:
Hi All, Is it possible to dynamically determine the current field element in a form? I ask because I have a 'tab' button on a form, and when a user clicks on it I need to be able to shift the focus to the next field, and also if the current field is the last field on the form, essentially to do nothing.
1
1703
by: Ben | last post by:
I have a Tabular form bound to a table. The purpose of this form is to get times from a timer and record them in a field. The timer dumps the time automatically through a serial port. When the time is recorded it goes to the next record. Sometimes a user may have to skip a record and come back. All of this is no problem and works great. I have 3 buttons that will set any penalties in a record. The person just needs to hit a button to...
20
2070
by: Prakash | last post by:
Hi ! I have a field "sub_tran_no" in my form in continuous view. When the user presses a button "Re-Number", I'd like to: 1) Save the current record pointer position 2) Save the current field which has focus 3) go to the top of the recordset & start re-numbering the "sub_tran_no" field with the values 1,2,3, until eof.
1
1822
by: David | last post by:
Using VB.net on a XP pro computer. When tabbing to a date Date picker field instead of puting focus on the month it puts the focus on the day. How can i correct this? Or is this a window controls - where windows remembers what part of the date field was last enter - and then goes to that section when you tab to that field again.
2
2085
by: William Cole | last post by:
Here is my issue I have two text fields (Field A, Field B). I want Field B to be updated when Field A is changed. The problem is Field A is being changed through JavaScript so an onChange event is not fired. Is there any way to make this work without having to change the code that changes Field A? Thanks, William
8
4332
by: sudha412 | last post by:
hi guys. i am facing one issue. For one text box field i have used fillowing code. --------------------------------------------------------------------------------------------------------- function fnCheckNreStatus() { if(document.getElementsByName(boName+".CustomerNREFlg").value == "N") { document.getElementsByName("3_AccountBO.DateOfBecomingNRE").value=''; setNextComp (boName+'.StaffFlag'); } ...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.