1

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.

1

3 Answers 3

1

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..... :)

1
  • Yes, this solution worked well. The width setting didn't really work so well. Changing the width put the scroll bar in the middle of the box. The box width seems to be aligned with the other box widths on the form. Just annoying how the generic forms are very tacky.
    – southskies
    Jul 9, 2015 at 7:30
0

Scroll Bars for Multiline Text Box in SharePoint

Use the below Image Code

Scroll Bars for Multiline Text Box in SharePoint

1
  • Hi Ravi, that image isn't displaying anything....
    – southskies
    Jul 9, 2015 at 5:59
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.