I use the below code to dynamically grow the Multi-Line fields on a form. This same code does not work for the Rich Text field. I would like to replace the Multi-Line fields with Rich Text fields. How can the Rich Text field grow in a similar manner?
//Below code autoadjusts height of fields set with CSS Class=autoadjust
$(document).ready(function () {
$('.autoadjust textarea').each(function () {
h(this);
}).on('lookup change keyup', function () {
h(this);
});
function h(e) {
$(e).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight);
}
//Below allows autoadjust to work in a collapsed section with CSS class set to defaultCollapsed
$('.defaultCollapsed ul').each(function() {
$(this).css('display','block');
});
$('.autoadjust textarea').each(function () {
h(this);
});
$('.defaultCollapsed ul').each(function() {
$(this).css('display','none');
});
});