ImageButton Click Event

T

TCORDON

Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form? How can I make
this happen?

Thanks
 
K

Kevin Spencer

Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form?

Okay, let's imagine that you have a form with 2 submit buttons, an an image
button (yes, this is possible). Which event handler should be called when
you press ENTER to submit the form?
How can I make this happen?

What you need to do is capture the ENTER key, and use JavaScript to click
the Image Button programmatically. If you don't know how to capture the
ENTER keypress event, Google it. Here's a start for you:

http://www.google.com/search?hl=en&q=JavaScript+capture+ENTER+Key

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
T

TCORDON

I have two different web pages...one has 2 textboxes (Username and Pwd) and
an Image button, in this webpage if the user enters his username and pwd and
hits enter, the ImageButton's click event is fired. In the other WebPage I
just have a Textbox and an imageButton, vut in this one if the user fills
the textbox and then hits Enter the form is just posted back, the click
event of the imagebutton doesn´t fire, why can this be?

Thanks Again
 
K

Kevin Spencer

The Great Karnak is having trouble seeing your source code.

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

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,777
Messages
2,569,604
Members
45,228
Latest member
MikeMichal

Latest Threads

Top