This is an example textarea form field that limits input to either 80 characters or 16 words, whichever comes first.

characters typed
characters left
words typed
words left

The form tag must have a name= attribute. In addition to what's in this example, your form tag will probably have method= and action= attributes, and possibly others. This example uses a TEXTAREA form field as the text field to be monitored. An INPUT bype="text" field may be used instead. The next four fields are where the number of characters typed, the number of characters left, the number of words types, and the number of words left are displayed. They all have a readonly attribute so the user can't change the number.