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!!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
this can be done with a small script in the the change event.
if (xfa.event.newText.match(/\b\w+?\b/g).length > 700) {
xfa.event.change = "";
}
Views
Replies
Total Likes
Hi,
this can be done with a small script in the the change event.
if (xfa.event.newText.match(/\b\w+?\b/g).length > 700) {
xfa.event.change = "";
}
Views
Replies
Total Likes
Perfect!! This is just what I needed. Thank you very much for your help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies