473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Clicking on textbox causes focus to go to a button

I am finding some odd behavior. When clicking in a textbox, I find that the
focus is resorting to a different button on my web page, not to the
textbox.. I would like the focus to remain on the textbox so that if the
user presses enter it will cause the textbox text changed event handler to
fire. I have been able to set up the text box to fire the event handler for
the textbox when clicking outside of the textbox, but if the user decides to
press enter I want the focus remaining on the textbox.

Any ideas?

Thx,

Tim
Nov 18 '05 #1
4 1331
JavaScript. You will have to mimic postback event in your client side code,
however.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Tim Meagher" wrote:
I am finding some odd behavior. When clicking in a textbox, I find that the
focus is resorting to a different button on my web page, not to the
textbox.. I would like the focus to remain on the textbox so that if the
user presses enter it will cause the textbox text changed event handler to
fire. I have been able to set up the text box to fire the event handler for
the textbox when clicking outside of the textbox, but if the user decides to
press enter I want the focus remaining on the textbox.

Any ideas?

Thx,

Tim

Nov 18 '05 #2
Hi Cowboy,

I know I need to use Javascript and can add it as part of the Attributes
for the textbox, but that still doesn't tell me why the focus gets set
to an entirely different button upon clicking insid ethe textbox. Can
you explain why I will need to implement the postback in javascript? I
already have auto-postback enabled for the textbox.

Thx,

Tim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
if you hit enter in a browser, the focus goes to the first submit button,
and the submit event is fired. this is how enter is defined to work.

in your case hitting enter in a textbox with autopostback should cause to
postbacks, one fired by the autopostback client code which is tied to the
onblur event, and one by the enter sending a submit.

-- bruce (sqlwork.com)
"Tim Meagher" <ti*@aaom.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Cowboy,

I know I need to use Javascript and can add it as part of the Attributes
for the textbox, but that still doesn't tell me why the focus gets set
to an entirely different button upon clicking insid ethe textbox. Can
you explain why I will need to implement the postback in javascript? I
already have auto-postback enabled for the textbox.

Thx,

Tim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4
hi bruce,

i have the same problem.
is it possible to change this behaviour of enter, or maybe to avoid
thar a button event gets fired as enter has been hitted

thanks, daniel
bruce barker wrote:
if you hit enter in a browser, the focus goes to the first submit button,
and the submit event is fired. this is how enter is defined to work.

in your case hitting enter in a textbox with autopostback should cause to
postbacks, one fired by the autopostback client code which is tied to the
onblur event, and one by the enter sending a submit.

-- bruce (sqlwork.com)
"Tim Meagher" <ti*@aaom.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Cowboy,

I know I need to use Javascript and can add it as part of the Attributes
for the textbox, but that still doesn't tell me why the focus gets set
to an entirely different button upon clicking insid ethe textbox. Can
you explain why I will need to implement the postback in javascript? I
already have auto-postback enabled for the textbox.

Thx,

Tim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #5

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

Similar topics

5
by: WindAndWaves | last post by:
Hi Gurus I have a very simple question this time. I have a continuous form with a textbox (ID number) and a label. The label has a on_click event: msgbox me.id.value If I click on the...
7
by: joey.powell | last post by:
I have a home page with username and password textboxes and a login button for purposes of users being able to log in (forms authentication) directly on the site home page. I also have a dedicated...
21
by: Darin | last post by:
I have a form w/ a textbox and Cancel button on it. I have a routine to handle textbox.validating, and I have the form setup so the Cancel button is the Cancel button. WHen the user clicks on...
1
by: jalpari | last post by:
hi all, i have created a form in which i have a button for searching records from database, when a record is found it'z displayed in the table fields and whenever the record'z not found it displays...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.