Make textArea expand at runtime


A property I can’t seem to change at run time:
The rows value.
I am trying to get the BS textArea to auto expand using:

                  txtRoom1.value = txtRoom1.value+'\n'+JSON.stringify(data);
                  var txtRoom1Rows = txtRoom1.value.split("\n").length;
                  $.jGrowl('txtRoom1 lebgth = '+txtRoom1Rows);
                  txtRoom1.rows = txtRoom1Rows;
                  document.getElementById("txtRoom1").rows = txtRoom1Rows;

both fail.
It works here


Steve Warby


The documentation does say Design Time Only for this property.

The method to change this at runtime probably fails with a Bootstrap Textarea since txtRoom1 refers to the Bootstrap wrapper around the textarea, not the actual textarea element itself. You should be able to get at it by using jQuery to identify the actual element.