limit text area words

Reply

Join Date: Mar 2007
Posts: 18
Reputation: thunderbbolt is an unknown quantity at this point 
Solved Threads: 0
thunderbbolt thunderbbolt is offline Offline
Newbie Poster

limit text area words

 
0
  #1
Oct 16th, 2007
Is there a way to limit how many words you can use in text area? I have searched the internet and have only found ways you can do it javascript not PHP.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: limit text area words

 
0
  #2
Oct 16th, 2007
I've always used javascript for this kind of validation as it's more useful client side, not so good for the user to wait for a server round trip only to find they typed too much.

PHP doesn't execute on the client so you can only inspect the length of the text from the text area form element once the form is submitted to the server. But this is more work as if you detect the length is too long now you have to render the form back to client with all the elements filled in as they were when the user submitted it so they don't have to do it over. ASP.NET makes that easy, I don't know if PHP has any tricks for keeping control state.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC