I'm looking for a solution for my contact page. In the past I've used javascript to limit the amount of characters in a TEXTAREA box. Does anyone have better suggestions or strong reasons why I shouldn't be using Javascript for this?
It's all in the name of trying to learn the right way to do things... and man, what a pain in the *bleepity* *bleep* *bleep* sometimes :twisted:
Best way to limit TEXTAREA??
It's the only 'immediate' way I can think of.
The other way is to wait until it's posted and do it in PHP, but then the user hasn't a clue about how close to the limit they're getting. If you provide a little counter as well then javascript seems the best way to do it. I've seen similar on Web-TXT services, they can be useful.
Best way to limit TEXTAREA??
No problem with using Javascript for that purpose, just make sure you also deal with trimming long messages on the server side as well for people who don't have javascript turned on.