How to Count/limit number of words entered by a user?
Below is the example to restrict the user to not enter more than 5 words.
Snippet:
if (xfa.event.newText.match(/\b\w+?\b/g).length > 5)
{
xfa.event.change = "";
app.alert("Maximum of 5 words are allowed");
}
Source: https://www.dropbox.com/s/a0vy1z1yvne7ut3/limit%20to%205%20words.pdf?dl=0
No comments:
Post a Comment