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 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!.


hi, what if i want to count words?
ReplyDeleteNo doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post. https://charactercount.org
ReplyDeleteResources like the one you mentioned here will be very useful to me ! I will post a link to this page on my blog. I am sure my visitors will find that very useful..
ReplyDeleteOracle DBA Online Training
I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. this
ReplyDelete