Nagaraju
Nagaraju

Reputation: 1875

Capacity of textarea

What is the maximum capacity of a textarea that it can accept some text.The html page is working fine when the text limits to about 130-140 words.But when the text exceeds that limit it doesn't do anything(just hangs). This text is passed through javascript for some manipulations and displayed in another textarea. If there is a limit how to make it accept large amount of text?

UPDATE :

I get the following error when I check the error log

request failed: URI too long (longer than 8190)

I am using the following line to pass the text through javascript

xmlhttp.open("GET","./analyze.pl?unk="+str ,true);

Upvotes: 2

Views: 651

Answers (2)

Tim M.
Tim M.

Reputation: 54378

The problem isn't with the <textarea>. The problem is that you are creating a URL that is too long.

Submit the data using a POST, not a GET and the problem will go away.

As a general rule: if you have occasion to worry about URL length, you are probably passing too much data via query string parameters. From a REST standpoint, consider that a GET is used to retrieve a resource. A GET should not be used to submit data that will create/update a resource (such as one might do when entering data into a <textarea>).

Upvotes: 1

Joe
Joe

Reputation: 8272

I use a maxlength of 8000 on one of my sites and it didn't have any problems. Your javascript must be the cause of the problem (guessing infinite/long loops) OR it must be the browser your testing on OR your computer.

It would be best if you show your javascript code.

Upvotes: 0

Related Questions