is there a way to fix the number of words in a textbox

Hello,
I have a form, but would like to fix the number of words that a user
can add to this to say 50 words.
Can this be done on the form, or would I need an external validation
script to count the number of words and then return a warning message?
Or would it be simpler to just display the first 50 words only, if so
how do I write the html to just show the first 50 words.
Thanks

Advertisements

Norman wrote:
> Hello,
> I have a form, but would like to fix the number of words that a user
> can add to this to say 50 words.
> Can this be done on the form, or would I need an external validation
> script to count the number of words and then return a warning message?
> Or would it be simpler to just display the first 50 words only, if so
> how do I write the html to just show the first 50 words.
> Thanks
>
You cannot do this with HTML. HTML is not a programming language, it is
markup that says "this is a paragraph" and "that is a list". You need a
script. JavaScript which runs on the client can to the job quickly as
the user types, but is not absolutely reliable because the user may have
JavaScript disable. The receiving server side script should have the
*final* word and check the input and bounce the user back to the form
with a error message if the input does not meet the criteria.

Advertisements

On Jun 19, 3:08 pm, "Jonathan N. Little" <>
wrote:
> Norman wrote:
> > Hello,
> > I have a form, but would like to fix the number of words that a user
> > can add to this to say 50 words.
> > Can this be done on the form, or would I need an external validation
> > script to count the number of words and then return a warning message?
> > Or would it be simpler to just display the first 50 words only, if so
> > how do I write the html to just show the first 50 words.
> > Thanks
>
> You cannot do this with HTML. HTML is not a programming language, it is
> markup that says "this is a paragraph" and "that is a list". You need a
> script. JavaScript which runs on the client can to the job quickly as
> the user types, but is not absolutely reliable because the user may have
> JavaScript disable. The receiving server side script should have the
> *final* word and check the input and bounce the user back to the form
> with a error message if the input does not meet the criteria.
>
> --
> Take care,
>
> Jonathan
> -------------------
> LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!