Posts tagged ‘submit’

Struts 2 bug - s:submit tag type=button rendering

Wednesday, November 28th, 2007

In Struts 2.0.11, the s:submit tag with type=button does not render properly.

While working on a project using Struts 2, I was attempting to create a HTML button that looked something like:

<button type="button" class="button positive save">
    <img src="/images/tick.png" alt="Save"> Save
</button>

I followed the Struts 2 Tag Reference for the submit tag and tried the following:

<s:submit type="button" cssClass="button positive save">
    <img src="/images/tick.png" alt="Save"> Save
</s:submit>

Instead of rendering like my example above, it looks like:

<img src="/images/tick.png" alt="Save"> Save
<button type="submit" id="test_0" value="Submit" class="button positive save">Submit</button>

Not exactly what I had in mind… ;)

Read the rest of this entry »