Image button acting like submit button.

R

Russell

I have a web page that i am using an image button as my submit button. The
code behind the button works, but when I click enter on the web page,
nothing happens. Can anybody tell me how to get my image button to act as
the default button on the form?

Thanks in advance
Russell
 
S

Steve C. Orr [MVP, MCSD]

E

Eric Cherng

Russell,

I've had this problem before too and, to my knowledge at least, there is no
direct way to achieve this. Instead what I did was provide a handler for
the text box that handles the enter key. If the handler gets called, it
just forwards the processing to the image button's submit handler. This
solution isn't exactly the most elegant way, but it works.

Eric
 
L

Lau Lei Cheong

It's very strange that in my project, they automatically act as a submit
button, so I have to add a (X,Y) = (0,0) checker in the click handler
routine just to skip when "enter" is pressed in the textbox.

Perheps there are more than one ImageButton in your form so the browser got
it mixed up.
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top