You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Luciano Costa <mo...@gmail.com> on 2007/07/12 21:41:06 UTC
[S2] SUGESTION=
I'd like to suggest the implementation of this simple but great-to-use
feature.
I've made hard use of textarea tag and it's boring to re-code it ever and
ever.
This sample code prevents use of javascript block in head section.
Once "<s:textarea>" already has "onKeyDown" and "onKeyUp" properties, I
think this js code could be added to these properties, in case of "maxlength
> 0".
tag code:
<s:textarea name="txt_1" maxlength="50"></s:textarea>
result code:
<textarea name="txt_1" onKeyDown="this.value=this.value.substring(0,50);"
onKeyUp="this.value=this.value.substring(0,50);"></textarea>
taglib:
<attribute>
<name>maxlength</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description><![CDATA[HTML maxlength handling via
javascript]]></description>
</attribute>
Att,
Luciano Costa
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org