Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint 2013 Multi-lines text Columns limit it to 400 char max

$
0
0

Hi All,

The Multi-line text field for custom list has more than 63000 character. Is there a way to limit it using Jquery?

I am using script editor web-part to embed the jquery. 

I have the code below, please advice.

description is the column internal name.

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function () {

    var maxLength = 400;
    $("textarea[id*=description]").attr('maxlength', maxLength);
    $("textarea[id*=description]").on('keydown keyup change', function () {
        var char = $(this).val();
        var charLength = $(this).val().length;
        var Text = charLength + ' of Maximum ' + maxLength + " characters allowed.";
        if (charLength >= 250 && charLength <= 350) {
            Text = "<font color='blue'>" + Text + "</font>";
        }
        if (charLength > 1950) {
            Text = "<font color='red'>" + Text + "</font>";
        }
        $("span[class='ms-metadata']").html(Text);
    });

}); 
</script>

Thanks,


Abenet


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>