:

Struts2 generates value = "Submit" which the W3C pegging validator says is an error

I have the following tag <s:submit>:

<s:submit action="shipment_deleteShipperFromChosenShipperViewList" 
          type="image" src="/llr/theme/delete.gif"
          onclick="clearDirtyFlag();deleteShipperFromChosenShipperViewList('%{organizationInfo.orgId}');"
          tabindex="16" />

which generates the following HTML:

<input type="image" 
       alt="Submit" 
       src="/llr/theme/delete.gif" 
       id="shipment_shipment_deleteShipperFromChosenShipperViewList" 
       name="action:shipment_deleteShipperFromChosenShipperViewList" 
       value="Submit"
       tabindex="16"
       onclick="clearDirtyFlag();deleteShipperFromChosenShipperViewList('1');"/>

The W3C markup validator ( W3C ) marks HTML as an error. Error message:

The attribute is valuenot allowed on an element inputat this point.

Obviously, it is valuenot a valid attribute when a type is an image. How to make Struts2 generate an attribute value?

+4
source share
1 answer

Until a fixed version is released, you have several options.

  • HTML <input type="image" ...> <s:submit>. simple, <input> HTML.

  • submit.ftl struts2-core .

  • W3C Markup Validator, , , , .:)

+3

All Articles