Code: Select all
<!-- Begin Textarea Grower
var agt=navigator.userAgent.toLowerCase();
function grow(t) {
a = t.value.split('\n');
b=1;
for (x=0;x < a.length; x++) {
if (a[x].length >= t.cols) b+= Math.ceil(a[x].length/t.cols);
}
b+= a.length;
if (b > t.rows && agt.indexOf('opera') == -1) t.rows = b;
}
// End -->It works fine in IE, in Opera it puts the caret back to the start of the textarea each time you press a key so that's trapped
In FF it just doesn't resize the textarea.
Any idea why not, or how I could do it so it does?