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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to