locked
CRM 2013 - Multiline Text Field with Vertical scroll Bar RRS feed

  • Question

  • Hi,

    I have a multiline text field (covering 2 rows) named "Important Note" in CRM 2013 Account form. I want this field not to expand as I add text on it instead have vertical scroll bar if I have texts more than that can fit in 2 lines. I get the vertical scroll bar in the edit mode but once I tab out of the field the field will expand to fit the entered text. I don't want other fields getting pushed down. I have these field properties set for this field (See screenshot 1)."Automatically expand to use available space" property" doesn't seem to change anything when I check it or unchecked it.

    Is there anyway to handle this without manipulating DOM? Thanks!

    Screenshot 1 - Field Properties

    Screenshot 2 - Field as seen in edit mode



    • Edited by Anna' Thursday, September 18, 2014 11:01 PM
    Thursday, September 18, 2014 8:28 PM

All replies

  • not able to find solution.

    regards,

    Jithesh

    Thursday, September 18, 2014 11:00 PM
  • It isn't a supported solution I don't think (however, this is following the same format as I was using in CRM 4 and it has carried through the versions without any issues.)

    However, you can make it stay the size it is supposed to be and scroll when not activated by the below.

    Our field was called caltech_comments.

    OnLoad

    var fn1 = "caltech_comments";
    var r1 = document.getElementById(fn1).parentNode.parentNode.rowSpan * 24;
    var r2 = r1 + "px";
    document.getElementById(fn1).style.maxHeight = r2;
    document.getElementById(fn1).style.overflow = "auto";

    OnChange; pass the name of the field as a string through

    function Commentslock(fn1)
    {
    var r1 = document.getElementById(fn1).parentNode.parentNode.rowSpan * 24;
    var r2 = r1 + "px";
    document.getElementById(fn1).style.maxHeight = r2;
    document.getElementById(fn1).style.overflow = "auto";
    var fn2 = fn1 + "_i";
    if (typeof document.getElementById(fn2) != "undefined") {document.getElementById(fn2).parentNode.style.overflow = "hidden";}
    }

    The one downside I've noticed is that there will be 2 vertical scrollbars in the multiline field until it has been changed. This doesn't affect us as most of our multiline fields are read only and added to via input from a single line text field. The second scrollbar is not visible unless you scroll horizontally however.

    Thursday, July 7, 2016 10:23 AM