You are viewing limited content. For full access, please sign in.

Question

Question

multi-line field auto expand on existing and next task

asked on March 29, 2021

Hi,

I have found some great posts and I am using this one https://answers.laserfiche.com/questions/160903/Assign-css-class-to-MultiLine-within-collection#160963, but wanted to know the following. On existing tasks that's open, it works great, but when the process goes to the next steps then the box is small again and then the user has to click and move the cursor. Is it possible for the field to auto grow and then stay the size it grew to on next tasks?

0 0

Replies

replied on March 29, 2021

Can you share the specific code you are using?  Most likely it's just a trigger based on a field change, and it would be a matter of duplicating it to also be triggered on form load.

0 0
replied on March 29, 2021

Hi Matthew,

 

This is the code i'm using in my Process

 

//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);
  }

});

 

0 0
replied on March 29, 2021

Hmmm...  Odd.  Seems to be working for me on testing.  Lines 3 and 4 should be triggering as the form loads to make the change.

0 0
replied on March 29, 2021

It works when I’m on the same user task, but as soon as when I submit to another user task, the the field is small again until I start typing or scroll down. Maybe I should clear my cache and see if it helps.

1 0
replied on March 29, 2021

Clearing cache also did not help my case

0 0
replied on March 30, 2021

You could try a JS line for $('.autoadjust textarea').change(); to trigger the change event when the form loads.

Note that in some situations the form elements load after the initial JS runs; if your JS fires off too quickly you could use a setTimeout to wait a half second before triggering the change.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.