| | |
limit text area words
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.
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.
![]() |
Similar Threads
- Get the text with mouse hover (JavaScript / DHTML / AJAX)
- How to rank well in msn? (Search Engine Optimization)
- Remove Selected Value from the Text Area (JavaScript / DHTML / AJAX)
- Problem in getting values of a text area by row and column wise (ASP)
- Listing words in an Array of text (C++)
- I've tried everything...setting font of selected text (Java)
- PLS Help newbie (Java)
- How do I limit text char in Combo box? (VB.NET)
- What ya think (Website Reviews)
Other Threads in the PHP Forum
- Previous Thread: how to call Stored Procedure in mysql by php
- Next Thread: displaying specific amount of results
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






