Index: lams_central/web/includes/javascript/common.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/common.js,v diff -u -r1.8 -r1.8.2.1 --- lams_central/web/includes/javascript/common.js 30 Apr 2014 22:47:32 -0000 1.8 +++ lams_central/web/includes/javascript/common.js 15 Jun 2015 22:42:48 -0000 1.8.2.1 @@ -107,4 +107,16 @@ xmlhttp.open("POST", url, false); xmlhttp.send(); } + +function getNumberOfWords(value, isRemoveHtmlTags) { + + //HTML tags stripping + if (isRemoveHtmlTags) { + value = value.replace(/ /g, '').replace(/<\/?[a-z][^>]*>/gi, ''); + } + value = value.trim(); + + var wordCount = value ? (value.replace(/['";:,.?\-!]+/g, '').match(/\S+/g) || []).length : 0; + return wordCount; +} \ No newline at end of file