• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TextArea Max Characters

 
Ranch Hand
Posts: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic