Sharpharp1
Apprentice

Re: Minimum and Maximum Word Count on Text Area Control?

Jump to solution

Another issue with this is that i do a LOAD method on a field with the text in and need a word count for that... Transferring the data in via load method does not activate the word count either...

 

Anyone?????

0 Kudos
Albarghouthy
Apprentice

Re: Minimum and Maximum Word Count on Text Area Control?

Jump to solution

Here is a working one:


 


 


<script>
$(document).ready(function() {
var wrdCountDataLabel = $("[name='WordCount']");
wrdCountDataLabel.parent().find('input[type=text], Textarea').on("keydown paste cut", function() {
var me = this;
setTimeout(function() {
var s = $(me).val().replace(/(^s*)|(s*$)/gi, "").replace(/[ ]{2,}/gi, " ").replace(/
/, "
");
var wordCount = s.split(" ").length;
if (wordCount === NaN) wordCount = 0;
$("[name='WordCount']").SFCLabel('option', 'text', wordCount);


})
});
})
</script>

 


 


 

Albarghouthy
Apprentice

Re: Minimum and Maximum Word Count on Text Area Control?

Jump to solution

In order to get it working with the load method, you need to add the following action after the load method:


 


then execute TextArea control's Focus method

 


and update the following line in your script to include focus, change and click


 


wrdCountDataLabel.parent().find('input[type=text], Textarea').on("keydown paste cut change click focus".....

 

Sharpharp1
Apprentice

Re: Minimum and Maximum Word Count on Text Area Control?

Jump to solution

Yeah, that's what i'm talking about. Kudos x100 Mustafa!!!

0 Kudos
AAschenbrener
Apprentice

Re: Minimum and Maximum Word Count on Text Area Control?

Jump to solution

So - I've been struggling with this almost exact situation today where I'm trying to count the characters - not the words.

 

KUDOS to figuring out you have to have everything in the same cell.   Got me one step closer.

 

But, has anybody figured out how to get character count and not just words?

 

 

0 Kudos
Amar1
Novice

Re: Minimum and Maximum Word Count on Text Area Control?

Jump to solution
Hi,
Have you done for the word count? if yes, can you please share the code snippet for reference.
0 Kudos