By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,971 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,971 IT Pros & Developers. It's quick & easy.

ImageButton Click Event

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
> 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...ture+ENTER+Key

--
HTH,

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

"TCORDON" <tc******@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl... 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

Nov 19 '05 #2

P: n/a
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
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uV**************@TK2MSFTNGP14.phx.gbl...
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...ture+ENTER+Key

--
HTH,

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

"TCORDON" <tc******@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...
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


Nov 19 '05 #3

P: n/a
The Great Karnak is having trouble seeing your source code.

--
;-),

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

"TCORDON" <tc******@hotmail.com> wrote in message
news:eN***************@TK2MSFTNGP12.phx.gbl...
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
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uV**************@TK2MSFTNGP14.phx.gbl...
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...ture+ENTER+Key

--
HTH,

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

"TCORDON" <tc******@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...
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



Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.