• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Re-evaluate Textarea

 
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm won't get too in depth (unless asked) but I have a few DIV tags which includes a textarea. The textarea basically fully displays (no scrollbars) within a DIV element. The DIV element does has scrollbars. If I start entering into the textarea the content of the textarea is pushed downwards, out of sight because the textarea does not have scrollbars. Can someone suggest a way for me to keep things the way they are (DIV element does the scrolling) but have the textarea expand as needed? Hopefully that makes sense. I'm kind of scrambling to find a solution (note: I am still trying to find the solution on my own as well).
 
Sheriff
Posts: 67754
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
I'm not exactly sure what you are trying to do, but have you investigated the CSS overflow rules?
 
Rob Hunter
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bear, I'm familiar with :-) I have two DIV elements, one has numbers listed in it and separated by break elements, and the other has a text area. I want the "lines" DIV element to display next to the textarea and have the textarea display entirely BUT I only want them to take up so much of the screen. I have a container DIV element that is set to a certain size and has scrollbars on it to allow scrolling. The textarea I have the scrollbars turned off because I don't want a nested set of scrollbars as well. The issue is when I type in the textarea the content goes off the textarea but the scrollbar for the container doesn't change. I can maneuver up and down the textarea with no issues using the arrow buttons on the keyboard but the scrolling area remains "fixed" at the size of the original content of the DIV elements when the page loaded. Is there a way to "update" the status of the parent DIV element without having to reload the page or similar?
 
Rob Hunter
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.... so the lines in the numbered DIV element line up with the lines of the textarea (like an IDE)
 
Saloon Keeper
Posts: 28713
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think probably you should use a TABLE element instead and use the left column for line numbers and the right column for text.

There was, of course, the fashion to sneer at TABLEs as obsolete, and to use ONLY things like DIV, but that equivalent would probably be to put a scrollable DIV inside a fixed-sized DIV with scrollbar, subdivide the inner DIV into 2 more DIVs and then put the TEXTAREA div into the right-hand side sub-div. Which is really just a more complicated way to doing it in a TABLE anyway.

Incidentally, a common trick for editable table cells is to keep them as constant text with an onclick script that swaps in a relocatable text editing control for editing purposes, then writes its contents to the overlaid table cell when the edit is committed.
 
reply
    Bookmark Topic Watch Topic
  • New Topic