Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TextArea Max Characters

 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following form:



It still gets cut off at 40 charcters even though the col is 70 (the submission received is only 40 chars of the original)?? Why is this happening? What is the fix?

Thanks,

Luke

[ July 22, 2005: Message edited by: Luke Shannon ]

[ July 22, 2005: Message edited by: Luke Shannon ]
[ July 22, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cols and rows values only set how the textarea will appear on-page and have nothing to do with the amount of characters that can be entered or submitted. Are you positive that the textarea contains more than 40 characters? And that the HTML for the textarea is well-formed? If the JSTL code inside your textarea emits text containing HTML markup, for example, things will go awry.

First step: when the page renders, do a View Source in the browser and carefully examine the HTML sent to the browser for anomolies.
 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks ok to me. What is returned is exactly 40 chars (not counting the comma). I submitted a 60 char input. Where is it getting chopped off?

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, your terminology is a little off. So what you are saying is that the JSTL that is populating the page is truncating what you expect to appear there. This is not the same as submitting the textarea which is what I thought you were referring to.

In that case, it most certainly has nothing to do with the HTML markup on that page and everything to do with how you're getting the text that you want to appear in the textarea to the request that's constructing the page.

So how's that happening? In other words, what is list.emailList and how is getting set up. That's where the problem most probably lies.
[ July 22, 2005: Message edited by: Bear Bibeault ]
 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing that confuses me is the form submits of a servlet that updates a DB. The db is only getting the first 40 characters of each input as well. I find it a weird coincidence that 40 happens to be the default limit to a HTML text area.

But if my HTML looks ok than I need to look in the servlet mentioned above, or the in the JSTL as you suggested.

Thanks,

Luke
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that 40 happens to be the default limit to a HTML text area.


There is no default limit to a textarea. Where did you get that from?
[ July 22, 2005: Message edited by: Bear Bibeault ]
 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This book:

http://www.peachpit.com/bookstore/product.asp?isbn=0321150686&rl=1

This book has generally been a good reference. It could be this is a mistake.

pg 278 in the chapter on forms:

If desired type cols="n", where n is the width of the text area in characters. The default value is 40


Anyway, I will keep playing with this. I'm sure it is something silly.

Thanks,

Luke
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, the cols attribute only defines the appearance of the textarea. It implies no limit on the number of characters that can be entered or that get submitted.

I'm also moving this along to the JSP forum as it's clearly not an HTML markup issue.
[ July 22, 2005: Message edited by: Bear Bibeault ]
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!