473,395 Members | 1,949 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,395 software developers and data experts.

ImageButton Click Event

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
3 7047
> 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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark | last post by:
Hi, I am trying to capture the click event of an ImageButton that exists in a composite server control that I am building. I create the imagebutton in the CreateChildControls routine '...
5
by: J McD | last post by:
Hi I have a DataGrid with an ImageButton column. When I click on an imagebutton I get a postback but it doesn't run the OnImgBtnClick method. I can actually comment out the line where I add this...
1
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new...
4
by: angus | last post by:
Dear all, I know that i can add a button with oncommand event "ImageButton_Command" by using the asp:ImageButton tag in the aspx code. <asp:ImageButton id="imagebutton1" runat="server"...
3
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image...
3
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, ...
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
0
by: Oddball | last post by:
I have set up a page with uses two lots of image buttons, one for a collection and one for more images from that collection. I generate all the image buttons on page init (I know, but I...
1
by: serge calderara | last post by:
Dear all, I gave a datagrid object wich has a template column define as follow : <asp:TemplateColumn HeaderText="Evt"> <ItemTemplate> <asp:ImageButton id="ImageButton2" ImageAlign=Middle...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.