Meaningless Drivel is fun!
The moose likes Struts and the fly likes How to set default image button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to set default image button" Watch "How to set default image button" New topic

How to set default image button

Salman Bashir

Joined: Aug 11, 2005
Posts: 3

I have 2 image buttons on my jsp page. And I want to set one button to defualt. That is when the user hits an Enter key on this page that particular default button should get selected and do the action specified to it.

Need your suggessions.

Thanks for your help.


Salman Bashir
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
Not sure I understand, is this a form post? Or just a link to an action?
SCJP 1.4
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Browsers will render the page so that the first button in the form's html is the one that submits the form when the user clicks Enter.

A good workman is known by his tools.
Consider Paul's rocket mass heater.
subject: How to set default image button
It's not a secret anymore!