开发者

How to get onReset attribute in struts2 form tag

开发者 https://www.devze.com 2023-01-29 14:18 出处:网络
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 recogn

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

精彩评论

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