You want something like this:
if(isIE()) {
text_area.style.height = text_area.scrollHeight + "px";
} else {
text_area.style.height = 0;
text_area.style.height = (text_area.scrollHeight -2) + "px";
}
see
http://bytes.com/topic/javascript/answers/615386-dynamically-resizing-height-textarea-known-width