wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60822
    
  65

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: 15376
    
    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;"
 
Don't get me started about those stupid light bulbs.
 
subject: Setting an image Button to Default on a jsp page
 
Similar Threads
how to upload an image through jsp
Custom TagLib Insert Head Info
problem with jquery post request
How to set default image button
Changing the display of an applet dynamically on a web application.