/    Sign up×
Community /Pin to ProfileBookmark

I have already added a textbox with chars count script. The problem is that when people copy and paste a huge spam line, example:eadadadsadfudad copied and repasted non stop is keeps going on one textbox line. THis causes the post to be completely messed up. What im asking is how can i make so the text box always goes down to the next line when the first is finished and doesnt keep going.

pics
what i want:
[img]http://i40.tinypic.com/295cy0m.jpg[/img]

stop this from happening:
[img]http://i40.tinypic.com/2h7hv9y.jpg[/img]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@NXInteractifMar 04.2009 — The "wrap" attribute of the <textarea> tag does work in most browsers, however, it fails if a word is simply way to long. For example, if you have a textarea where cols="10" and the text entered is "Hello, world. This is my text" then it should wrap provided you've set the wrap attribute. However, if the text entered is "Looooooooooooooooooooooooooong word" then the word "Looooooooooooooooooooooooong" will cause horizontal scrolling.
Copy linkTweet thisAlerts:
@omnicityMar 04.2009 — I would suggest that you write a function that inserts a space every dozen or so chars unless it finds a space itself. Not too many words in English exceed that length - but it is just off the top of my head: best of all is to work out what the maximum word length that could possibly fit into your text box. Some languages, such as German, can have extremely long words by our standards.

Try a regExp that searches for 12 occurrances of anything except whitespace, then replace with same group, plus a space or a hyphen or something.
×

Success!

Help @stevehossy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...