Multiline form expanding height

Hi, new user, please be gentle

How can I set a web page multilink form box (plain text only) to expand if the text field overspills the default box size? The default setting gives about 2 lines of text in my form, so not helpful to see 500 words+ which it will need.

A (less desireable) alternative would be to the fix the multiline field box height to say 400px, can this be done?

Thanks for any help, appreciated.

Hello @CBS,

Welcome to Plumsail Community!

You can adjust the height of the Plain Text field input to the content using this code:

fd.spRendered(function() {
    //Replace FieldName with the internal name of the field
    var textArea = fd.field('FieldName').$refs.textarea;
    function recalcHeight() {
        textArea.style.height = (textArea.scrollHeight > textArea.clientHeight) ? (textArea.scrollHeight) + "px" : "120px";
    }
    recalcHeight();
    $(textArea).keyup(recalcHeight);
});

Hi mnikitina,

Thank you very much - I will give this a try!

@mnikitina Please help.
I checked that, it is not work now

Dear @itapps,
Just used it in SharePoint forms on a form, works just fine:
Designer_FH80VAZyZz

Can you attach some screenshots or a video of how it looks for you?

@mnikitina I just tried to use another fd.spRendered(function() {}), but not my own fd.Rendered(function() {}). Then it is ok. Thank you

1 Like