aspose file tools*
The moose likes Struts and the fly likes struts2 submit button rollover Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 submit button rollover" Watch "struts2 submit button rollover" New topic
Author

struts2 submit button rollover

Bill Zelan
Ranch Hand

Joined: Jan 09, 2009
Posts: 46
hello,
i have a struct2 submit tag (s:submit) of type='image '. how do i implement rollover?

i tried the javascript way, but i am not able to change the image when the mouse hovers.
below is the code

<script language="JavaScript" type="text/javascript">
<!--
if (document.images) {
buttonup = new Image();
buttonup.src = "images/greenArrow.PNG" ;
buttondown = new Image() ;
buttondown.src = "images/blueArrow.PNG" ;
}
function buttondown( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "down.src" );
}
}
function buttonup ( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "up.src" );
}
}
// -->
</script>





the struct tag in the body

<s:submit onmouseover="buttondown('button')" onmouseout="buttonup('button')" id="arrow" type="image" src="images/greenArrow.PNG" />
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Bill please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it.

Look at a tutorial like this for what you want to do with the image button...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bill Zelan
Ranch Hand

Joined: Jan 09, 2009
Posts: 46
ok ankit.

javascript




the struct tag in the body

Bill Zelan
Ranch Hand

Joined: Jan 09, 2009
Posts: 46
thanks ankit.
its solved

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 submit button rollover