Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    41
    Thanks
    14
    Thanked 0 Times in 0 Posts

    How to let textarea appear big enough for whole content?

    Assume in multiple textareas appear some source code text whose number of lines varies from textarea to textarea.

    Is there a CSS style which I can attach to such a textarea and which tells the browser:

    "make textarea automatically big (height) enough to show ALL lines in textarea + 1 blank line at the end but NOT bigger/heigher/more rows than necessary?

    If this is not possible with CSS then at least is there a javascript command which let me calculate the number (and assign the "row" parameter to the textarea?

    If lines are longer then current textarea width/columns then these lines should be wrapped.

    Peter

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Dec 2011
    Posts
    41
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Thank you, but your solution is for text which is for text which will be entred in the future.

    I need a solution which adjusts the height of an textarea which is ALREADY filled with text.

    What can I do here?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •