After hours of trying to figure out where I went wrong, I finally found out that you cannot set the rows of the textarea once you set the scrollHeight for the textarea. Why is that happening, and how would we fix it?
<?php
include("ajaxLink.php");
?>
<textarea id = 'textarea' cols = '30' rows = '3' onkeydown = "changeIt()">
text text text text text text text text
text text text text text text text text
text text text text text text text text
text text text text text text text text
text text text text text text text text
text text text text text text text text
text text text text text text text text
text text text text text text text text
text text text text text text text text
</textarea>
<script>
//******************************************************************
function changeIt() {
$('#textarea').height($('#textarea')[0].scrollHeight);
document.getElementById('textarea').rows = 1000;
} //end of function changeIt()
//******************************************************************
</script>
Obviously, this isn't the actual function that I'm using, and it's just here to serve as an example to prove that setting the rows of the textarea doesn't work after setting the scrollHeight.