Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limit characters in a single word

Status
Not open for further replies.

storm1976

Programmer
Jul 6, 2001
31
GB
hi,

this is just a question also wondering if im in the right place to post this.

I am writing a small basic forum. when people post a reply or a thread i would like to be able to limit the characters on a word for example dont want people to post this: aaaaaaaaaaaaarrrrrrrrrrrrrrrrrrrgggggggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhhhhhh.

at the moment this stretches my page and takes tables out of line.

so bottom line is there a way to limit words to 20 characters when posting a form? the reply/thread is posted in a textarea.

cheers in advance
Storm

p.s. if this is in the wrong forum tell me too.
 
javascript check....

function checkField()
textArr = document.myForm.myTextArea.value.split(" ")
for (x=0; x<textArr.length; x++){
if (textArr[x].length > 20){
alert(textArr[x] + &quot; is too long&quot;)
return false;
}
}
return true;
}

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top