开发者

How to get onReset attribute in struts2 form tag

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜