Closed Thread Icon

Topic awaiting preservation: how to limit characters in textarea (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=27070" title="Pages that link to Topic awaiting preservation: how to limit characters in textarea (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: how to limit characters in textarea <span class="small">(Page 1 of 1)</span>\

 
dade
Nervous Wreck (II) Inmate

From: Kansas, just this side of the rainbow
Insane since: Sep 2004

posted posted 11-29-2005 21:24

I am just curious, is there a way to set a character limit in a textare field using PHP or something similar? I don't really know Javascript that well, but I was hoping that you could make the type just stop when a limit was reached like at 150 characters. Any suggestions?

Thanks

This patient is ready for his medication!

DmS
Maniac (V) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 11-29-2005 22:38

Basically, PHP, ASP etc runs on the server, before the page is sent to the client and then the server remains in total ignorance of what happens to the page in the client until the page is sent back to the server, or as a new page is requested.

The normal way to do this is to use javascript on the page to validate the form, then back that up with a validation on the server as the form is posted.

Now, with the introduction of AJAX it is possible to use javascript to communicate with serverside scripting without reloading the page.

That however, would in this case be far more complicated than having a javascript function that counts the characters entered in the textarea as they are entered and alerts the user when a limit is reached.

/Dan

{cell 260} {Blog}
-{"Theories without facts are just religions...?}-

« BackwardsOnwards »

Show Forum Drop Down Menu