.Net ramblings
# Wednesday, 30 August 2006
A javascript function to enable MaxLength behaviour for Multiline Textboxes
http://www.dynamicdrive.com/dynamicindex16/maxlength.htm

<script type="text/javascript">

/***********************************************
* Textarea Maxlength script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

</script>


<textarea maxlength="40" onkeyup="return ismaxlength(this)"></textarea>


Wednesday, 30 August 2006 17:12:43 (GMT Daylight Time, UTC+01:00)  #    Comments [0]  Asp.Net