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

Discussion in 'HTML' started by Norman, Jun 19, 2007.

  1. Norman

    Norman Guest

    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
    Norman, Jun 19, 2007
    #1
    1. Advertising

  2. 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 STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jun 19, 2007
    #2
    1. Advertising

  3. Norman

    Norman Guest

    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


    Thanks, for your reply.
    Norman, Jun 19, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Strøiman
    Replies:
    1
    Views:
    2,071
    Peter Strøiman
    Aug 23, 2005
  2. Xah Lee
    Replies:
    22
    Views:
    1,111
    Tim Roberts
    Mar 21, 2006
  3. Richard Heathfield
    Replies:
    7
    Views:
    350
    Barry Schwarz
    Oct 5, 2003
  4. Xah Lee
    Replies:
    23
    Views:
    1,049
    Tim Roberts
    Mar 21, 2006
  5. Xah Lee
    Replies:
    21
    Views:
    770
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page