Make textArea expand at runtime


#1

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 https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_textarea_rows2

Cheers

Steve Warby


#2

The documentation does say Design Time Only for this property.

http://wiki.nsbasic.com/Textarea_(Bootstrap)

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.