I am executing the attached javascript to adjust the height of textarea fields in an inquiry form. The code works fine for standalone textarea fields, but always returns zero for the scrollHeight of textarea fields in a table. Any insights would be appreciated.
$(document).on("onloadlookupfinished", function() { // $(':hidden').removeClass("hidden"); $('[readonly]').prop('tabindex', -1); // Adjust height of large text fields $("textarea").each(function (index, element) { // does not work in review steps table - Later const holdElem = document.getElementById(this.id); let compHeight = holdElem.scrollHeight; console.log(this.scrollHeight); this.style.height = "auto"; compHeight = this.scrollHeight; console.log(this.scrollHeight); if (compHeight > 58) compHeight = compHeight + 2 else compHeight = 60; this.style.height = compHeight+"px"; console.log("resize ",index, " ", this.id, " ", this.scrollHeight, " ", compHeight); }); });