Search This Blog

Tuesday, October 4, 2016

Character or Word Count for Multi line Text box in SharePoint List Forms

Character Count for Multi line text box in SharePoint New,Edit List Forms.

Step 1 : Open your List new/edit form using SP Designer.

Step 2: Add <span> tag under your multi line text filed description in the New form.

<span title="4000" id="commentscount">4000</span><span> Characters Left</span>













Step 3: Add the below code in your New form. and download jquery latest file.

<script type="text/javascript" src="../../Style Library/Scripts/jquery-3.0.0.min.js"></script>
<script type="text/javascript">

$(document).ready(function() 
{
//character count
$("textarea[name*='ff43']").keyup(function () {
characterCount('ff43', '#commentscount');
});
function characterCount(controlID,spanId)
{
 var controlVal = $("textarea[name*='" + controlID + "']");
 var cmax = $(spanId).attr("title");
 if(controlVal.val().length >= cmax) {
     controlVal.val(controlVal.val().substr(0, cmax));
  }
 $(spanId).text(cmax - controlVal.val().length);            
}

 }); 
 
 </script>

Step 4: Save the form and refresh your page.









Happy Coding!.

2 comments:

  1. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    Sharepoint Training in Chennai

    ReplyDelete
  2. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

    ReplyDelete