how to have return key cause postpack?

G

Guest

I want the Return Key to do a postback of an ASP.Net form. What's the
right way to set that up?? I don't want to interfere with the asp.net
framework.
I guess my options are to set the ACTION attribute or inject some
javascript.
This is under 1.2, not 2.0 yet.
Thanks
 
E

Eliyahu Goldin

Add a hidden submit button:
<input type=submit style="display:none">
and make sure it is the first button on the form. Hitting Enter will have
the same effect as clicking this button. It will cause a postback.

Eliyahu
 
G

Guest

Eliyahu,
Thanks for the reply. This does postback, but seems to be interpreted as
the click on the 1st Visible button on the form. The framework seems to be
searching for a good button to fire.
The solution was to use an ImageButton, with zero Width/Height, as the
first thing on the form.
-- Chris
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top