Question

I have some long multi line column on my list. In my dispform, newform and editforms I want to change the appearance of this field to have a vertical scrollbar, rather than just displaying the whole field in its entirety.

Within the edit form, I can change the field to be say 5 lines to limit the size of the box, but the box is still unwieldy within the dispform. Even so, having a static size box is still very tacky for the edit and newforms.

In prior versions of sharepoint, it seemed to magically determine that a scroll bar was required, but in SP2013, it doesn't seem to work the same way, and I cannot get the scrollbar to show.

I've successfully got the jquery function to locate the field, but am having problems getting it to change the field to have the scrollbar.

Note: I do not have access to sharepoint designer.

The code I have is

<script src="https:.../jquery-1.11.3.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
       var fieldTitle = "Comments";
          $('td nobr:contains("' + fieldTitle + '")').attr("scrolling", "yes");   

Any help on getting my jquery to work (or other settings I should be looking at) would be much appreciated.

Was it helpful?

Solution

You can use below mention CSS to fix the height of all multi line textbox whether it is in list view or in quick edit view.

.ms-rtestate-field {
    max-height: 100px;
    overflow: auto;
    width: 250px;
    word-wrap: break-word;
}

Change the height & width as per your needs.

Apply this CSS in SharePoint master page if you want to to work for all multiline contents. If yo want it for a single page than add it to CEWP on specific page.

Happy Coding..... :)

OTHER TIPS

Scroll Bars for Multiline Text Box in SharePoint

Use the below Image Code

Scroll Bars for Multiline Text Box in SharePoint

Try giving the multi line textbox a fixed height. It will automatically add a vertical scrollbar.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top