struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luciano Costa" <mont...@gmail.com>
Subject [S2] SUGESTION= <s:textarea maxlength="" />
Date Thu, 12 Jul 2007 19:41:06 GMT
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


Mime
View raw message