This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Setting an image Button to Default on a jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Setting an image Button to Default on a jsp page" Watch "Setting an image Button to Default on a jsp page" New topic
Author

Setting an image Button to Default on a jsp page

Naveen bpl
Greenhorn

Joined: Apr 03, 2005
Posts: 11
Hi,

I am writting an application using jsp and struts.
I have 5 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.

Please suggest.

Thanks in advance.

Naveen
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63195
    
  69

Moved to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
Play with this:

onkeydown="if ((event.which && event.which == 13) ||
(event.keyCode && event.keyCode == 13))
{document.FormName.ButtonName.click();return false;}
else return true;"
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Setting an image Button to Default on a jsp page
 
jQuery in Action, 3rd edition