• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Submit tag with Image

 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again all I am curious if there is an easy way to put an image as a submit button instead of using the button that is given. I want to put an image to represent select all/select none for a list of checkboxes, but haven't seen anything that suggests it is a simple change. It's a nice to have mostly for aesthetics. I'm using Struts 1.2.9 if that makes any difference.
From the research I have done it seems that I will be required to get an action and a method involved for it. Is there no way to do it without going down that route ?

thanks again for all your time.
 
Paras Jain
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the styleclass attribute.
something like
<html:submit value="submit" styleClass="submit" />

and in the style you can write something like as
.submit {
width: 108px;
height: 21px;
padding: 20px 0 0;
margin: 0;
border: 0;
background: transparent url('../images/btn_submit.gif') no-repeat center top;
overflow: hidden;
cursor: pointer; /* hand-shaped cursor */
cursor: hand; /* for IE 5.x */
}
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that's awesome if it works. I'll hopefully try that out tomorrow.
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just wanted to say thanks again it works beautifully. I can't believe I couldn't think of something that simple.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic