Clicking on textbox causes focus to go to a button

  • Thread starter Thread starter Tim Meagher
  • Start date Start date
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
 
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!
***************************
 
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
 
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)
 
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
 
Back
Top