Jump to content
  • 0

text area auto size (vertically)



Is there a way to make this field "auto size" itself based on content entered? If I make the rows to large and only use two roes, it requires huge scrolling within a tiny window frame. If I select 20 rows (as shown) and only enter two rows of data/text, there's a huge open area below. :-(

It would e nice to have it expand/contract as content is entered.  Not sure if such java code even exists as I've tried searching teh internet with no avail. :-(

See attached.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @DavidBRX. You may try the code below. Add a header and footer on your datapage and disable the HTML editor:



.cbFormTextArea {
  resize: none; 
  overflow: hidden;



document.addEventListener('input', function (event) {
  if (event.target.tagName.toLowerCase() !== 'textarea') return;
}, false);

function autoResize(textarea) {
  textarea.style.height = 'auto';
  textarea.style.height = textarea.scrollHeight + 'px';



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...