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

Question

Question

Forms pagination - Unable to dynamically adjust the field height of a multi-line field on pages > 1

asked on February 5, 2018

I am attempting to use to auto adjust a multi-line fields height on a LF Form that has Page Breaks/Pagination tabs. There was a previous post (https://answers.laserfiche.com/questions/78652/Dynamically-adjust-the-field-height-of-a-multiline-field ) that works really well, except with Pagination on Pages 2 + . It works ok on Page 1, but not all other pages. 

On Pages 2+ it appears as a very small height initially, that does auto adjust after typing, but it still looks poor like this. See an example of a screen shot.

Wondering if anyone can help?

 

cheers

Multi-line height on page tabs.JPG
0 0

Answer

SELECTED ANSWER
replied on February 5, 2018

Hi Grant,

Try this...

// Applied globally on all textareas with the "cf-medium" class
$(document)
    .on('focus.cf-medium', 'textarea.cf-medium', 'change.cf-medium', function(){
        var savedValue = this.value;
        this.value = '';
        this.baseScrollHeight = this.scrollHeight;
        this.value = savedValue;
    })
    .on('input.cf-medium', 'textarea.cf-medium', 'change.cf-medium', function(){
        var minRows = this.getAttribute('data-min-rows')|4, rows;
        this.rows = minRows;
        rows = Math.ceil((this.scrollHeight - this.baseScrollHeight) / 15);
        this.rows = minRows + rows;
    });

I used this for a multi-line field form a while back.

1 0

Replies

replied on February 6, 2018

Hi Jonathan,

Great, thanks for this! It worked well, I adjusted a few settings and it has fixed my issue. Appreciate your help.yes

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

Sign in to reply to this post.