473,795 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could of field with autopostback - how to be able to set focus correctly.

I have a couple of fields that are autopostback and I want to make tab work
correctly between them. But whenever somebody changes the value and clicks
somewhere else the page reloads as it should but there is no field with
focus.

So how can I tell what field the user clicked on before the page reloads,
save that and set the focus to that field once they are done.

TIA - J.
Oct 4 '07 #1
1 1478
On Oct 4, 11:33 am, "Mufasa" <j...@nowhere.c omwrote:
I have a couple of fields that are autopostback and I want to make tab work
correctly between them. But whenever somebody changes the value and clicks
somewhere else the page reloads as it should but there is no field with
focus.

So how can I tell what field the user clicked on before the page reloads,
save that and set the focus to that field once they are done.

TIA - J.
I don't think what you are looking for can be done without client
scripting of some kind (Javascript). The PostBack will result in the
page being redrawn and the tab position being reset to the 1st Control
in the Control tree. In the OnChanged event (server-side), you could
possibly use the ClientID attribute of the Texbox Controls and use
response.write( "<script language=javasc ript>SET FOCUS USING JAVASCRIPT
HERE</script>").

I've used something similar in the past but IE7 broke that code so I
won't post it here. Actually, the code wasn't to standard so I can't
blame IE7 for my bad programming :-)

Anyway, something like that should work but it may cause other
problems and may not be cross-browser compatible... you'll want to
check on that too.

HTH,

-E

Oct 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9050
by: Scott M. | last post by:
If I put RequiredFiledValidators on a page and set them up with corresponding TextBoxes everything works just fine. If I add a DropDownList and set its AutoPostBack to True, I am able to post data to the server WITHOUT the validators invoking their validation. It seems that the easiest solution would have been for MS to simply give the DropDownList control a "CausesValidation" property, but it does not have one. How can I invoke the...
6
327
by: Sunil | last post by:
Dear All I am a bit confused about AutoPost Back. My concept about AutoPostBack is that If AutoPostBack i "TRUE" for a Web Form the Web Form Goes back to the server and displays a fresh copy of th Web Form on the Browser. While If an AutoPostBack is False then the Web Form Stays on the browser and does not take a trip to the server Please let me know If I am saying correct Any help much appreciated
2
2343
by: Mad Scientist Jr | last post by:
I have autopostback turned on for Textbox1. When the user tabs out of it, the codebehind recalculates some other fields based on its value, and the user should be able to start typing a value in the next control Textbox2. However, when the page is rendered, the focus goes back to Textbox1. In order to go to the next control the user has to hit tab twice - once to recalculate, and once to tab out of the control. Is there some way to make it...
3
491
by: JJ | last post by:
Hi, If a control has autopostback set to true does that mean when the control losses focus then the page will postback again? A submit button will do the same thing as a control, lets say for interest sake a datalist control with autopostback set to true, both of these controls are causing a page postback correct? Thanks,
4
2586
by: bienwell | last post by:
Hi, I have a problem and really need your help. In my web page ASPX, I have some text fields to accept data from users. I did form validation like this : <td class="dataTD" style="HEIGHT: 30px" width="100"> <asp:TextBox id="txtFUEL_ISSUED1" style="Z-INDEX: 100; POSITION: absolute" runat="server" Width="107px" BorderColor="Transparent" autoPostback="true"
1
1969
by: robin9876 | last post by:
In Asp.Net v1.1 web form I have a number of controls which have the autopostback enabled. Is it possible after the autopostback has run that the control that caused the autopostback to get the focus?
1
2110
by: danyeungw | last post by:
I get the following from the link http://support.microsoft.com/kb/314206. I need to have both work - the page stays where it is and set focus to next control. Does anyone have solution? I have been working on this for days. I am using ASP.NET 2003. Thanks. DanYeung PRB: Controls Lose Focus When You Enable SmartNavigation and AutoPostBack View products that this article applies to. Article ID : 314206 Last Review : February 23,...
4
5960
by: =?Utf-8?B?UmVuYXVkIExhbmdpcw==?= | last post by:
Hello, I have a strange yet very simple problem with the asp.net Textbox web control. On an empty asp.net page, add a single asp:TextBox control with Autopostback=false with nothing else on the page. according to the doc, hitting Enter while the TextBox has focus should do nothing since Autopostback=false. The problem i have is that it posts the form (that is, it ignores the Autopostback=false).
1
1532
by: Mufasa | last post by:
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.
0
9672
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
10438
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...
1
10164
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
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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...
1
7540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.