Wendy,
  So you use the style sheets as a way to attach the image to the button?

Wayne Christian
Sr. Staff Software Engineer
Genesys Telecommunications Labs
2100 Gateway Centre Blvd.  Suite 300
Morrisville,  NC      27560
?       Office: (919) 466-6151
        Fax:    (919) 466-6157
?       EMail:  mailto:[EMAIL PROTECTED]

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 12:45 PM
To: 'Struts Users Mailing List'
Subject: RE: images in html buttons

Wayne wrote:
> Within the body of a standard HTML <button> tag, I can place HTML,
> such as the <img> tag and this will get rendered
> as the button image.  With struts <html:button> tag, this doesn't work
> and I get the raw text rendered as the button text.
> Is there a way around this other than going to image maps which don't
>  work the same way as buttons do?

Not sure if <html:button> works the same as <html:submit> but I have the
same problem with submit buttons.  My workaround involves JavaScript:

<script>
function setUserAction(target) {document.forms[0].userAction.value=target;}
</script>

<html-el:hidden property="userAction" value="error"/>

<html-el:submit property="submit"  onclick="setUserAction('Add Prospect');"
styleClass="addButton" titleKey="button.add.prospect" value="     "/>

Setting the 'value' to several spaces (otherwise Netscape buttons are
squished) means you can't tell which button was clicked, so the javascript
sets that userAction property, and that's the one that the
LookupDispatchAction uses to decide what to do next.

--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to