Clicking on textbox causes focus to go to a button

T

Tim Meagher

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
 
G

Guest

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!
***************************
 
T

Tim Meagher

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
 
B

bruce barker

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)
 
D

Daniel

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
 

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,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top