Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Limit word count in a text field?

$
0
0

I have two fields:

txtStageContent (where the user types in information)

WordCountResult (this field displays the words counted in the txtStageContent)

 

in the exit event for txtStageContent I have the following code to count the number of words (which works):

var cnt = word_count(this.rawValue);

WordCountResultTwo.rawValue = cnt.toString();

 

function word_count(textParam)

{

          textParam = textParam.replace(/^\s*|\s*$/g,'');

            if (textParam)

                      return textParam.split(/\s+/).length;

          else

                      return 0;

}

 

My Question is:

I would like to have a limit of 700 words in the txtStageContent text field, can this be done?

 

Thanks in advance for your help!!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



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