Here is the small code-snippet which demonstrates how to resize the textarea, so the text could fit its height, without displaying the scrollbars.
var IsIE = document.all?true:false
function textarea_resize(textarea_obj) { if (textarea_obj.scrollHeight >= 182) // ~ 12 rows maximum textarea_obj.style.overflow = '' else { if (!IsIE) textarea_obj.style.height = 1 textarea_obj.style.height = (textarea_obj.scrollHeight + 15) + 'px' // row height ~ 15 pixels } } Works at least in IE7, FF2/3, Opera 9. |