struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Armstrong" <>
Subject RE: html_image property value not submitted
Date Sat, 27 Sep 2003 15:28:21 GMT
The "value" attribute of an HTML 'input type="image"' tag (i.e., what the
Struts <html:image> tag is generating) is apparently ignored by all (most?)
browsers.  See:

One solution is to have a hidden variable in your HTML form associated with
your form bean (let's use the bean property name "action") and then use
JavaScript to set this property appropriately on submit.  Something like,

<html:hidden property="action"/>
<html:image property="" styleId="button" page="/images/save.gif"
                     document.forms["myForm"].submit();' />

In the action associated with your form, you can then consult the "action"
property of your form bean to determine the type of image button that has
been selected.


-----Original Message-----
From: Norbert Spemm []
Sent: Friday, September 26, 2003 9:25 PM
Subject: html_image property value not submitted


I wanted to replace the buttons on my form with images.

Before I had a working application with this tag in the jsp:

    <html:submit property='SubmittedAction' styleId='button'

now I tried with

    <html:image property='SubmittedAction' styleId='button' value="Save"

The problem with the image-version is, that my action now doesn't
receive a value for the parameter "SubmittedAction" anymore. Instead I
only get the parameters SubmittedAction.x and SubmittedAction.y which
are of no use for me.

What am I doing wrong? I'm using Struts 1.1

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message