Anonymous
public text v1 · immutable
function autoResizeTextArea ()
{
var rgLines = this.value.split('\n');
var nRows = 1;
for (var i=0; i<rgLines.length; i++ )
if (rgLines[i].length > 80)
nRows += Math.ceil (rgLines[i].length/80);
nRows += rgLines.length;
if (nRows > this.rows)
this.rows = Math.min (nRows, 30);
}