#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    2
    Rep Power
    0
    How can I ensure that users don't enter long lines of text into a text area box with no spaces into a text area field? ie.:

    fgfhgjhgfjhgjhgjhgjhgjhgjhgjhgjhgjhgjhgjhgjh

    I would like the script (an interactive story which takes the entry of a form and posts to an html file) to insert a space if it comes across a line of more than 25 characters in a row without a space. Specifically so tricksters can't wreak havoc with the table layout. I also don't want to limit the entries of those who are really wishing to be a part of the story.

    I can give more info about the existing script, if necessary. I also apologize ahead of time if you post a reply and I have to ask more questions because this is very new to me.

    Thank you
    Ramsie Shick
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    eugene, or, us
    Posts
    8
    Rep Power
    0
    What you are looking to do can be done with a well thought out regular expression. I would have to play around with it a bit, as regular expressions tend to involve a fair amount of trial and error work. You may want have perl look for a maximum number sequencial alpha-numberic characters before hitting a space or something.

    Good luck.

    Greg

IMN logo majestic logo threadwatch logo seochat tools logo