I want to use a javascript function to get call开发者_Go百科ed when a form is reset. For this exists the attribute "onReset" of standard HTML form, but I'm using Struts2 tags and they don't recognize onReset as a valid attribute.
"Attribute onReset invalid for tag form according to TLD"
The tag library declaration:
<%@taglib prefix="s" uri="/struts-tags" %>
Anybody know how can I call a javascript function on reset of a form created with struts2?
Update
This is actually a bug in the Struts2 form tag. The onreset
attribute is not being passed along to be rendered as part of the output. I have informed Apache of this bug.
Original Answer
Tag library attributes are case-sensitive. In fact, the Struts2 form tag does have an onreset
attribute, but it is all lowercase.
精彩评论