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 6 of 6
  1. #1
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post

    Textarea, Overflow and Max-Height

    hey, thanks in adavnce for any input!

    http://r6.killerb.net/cat/exim/#page

    I want the textareas to adjust to the size of the content here. Like if its one line, it should be 1 line, if its a few lines, be a few lines, unless its like 20 lines, I want it to overflow:auto.

    I would think this can be done with max-height:10em and overflow:auto,
    but it doesnt seem to be working. I think this may be because they are textareas which require the cols and rows attributes and already do some sort of overflow handling? is this true?

    The only reason I'm using textarea elements is because I want to be able to have the JS onclick event select all the text in the element, and i couldnt get it to work with a pre tag. Perhaps this is my flaw and it is possible to select all onclick in a pre?

    thanks again!
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Sounds like you need overflow: visible, but it doesn’t seem to work on textarea elements.

    Do you need all of the text to be selected so that it can be copied or just for the visual effect? If it's just for the visual effect, using text boxes for that purpose is unnecessary.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #3
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post

    copied

    the functionality of the 'select all' is to facilitate the copying of the snippets. Its not just for effect.

    So i take it i am correct in finding that you can only have JS select the contents of inputs and textboxes? not things like pre? Honestly I'd rather use something like a pre, being as it could validate without the rows and cols attributes which are just more crap to type.
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    So far as I know, that is correct. I wasn’t even aware that you could select text using JavaScript though so maybe there’s a solution that I’m not aware of.

    By the way, I’m of the opinion that the col and row elements should be deprecated since the size of a textarea element is generally defined by CSS and the attributes seem presentational. Not sure why they’re still required.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #5
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post

    hmmm....

    I think the rows and cols attribs might still be required because it's effects should provide the functionality to the form elements even even when there is no css. As in to ensure accessability, the size of the textarea should be defined reguardless of the media type? I really dont know about this, tho.

    Any other ideas on how to fix my little conundrum?
    (I guess maybe i should explore som JS solutions?)

    lemme kno, and thanks in advance for any input!
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Well, I don’t believe that single line input boxes require dimensions to be specified and they seem to display fine without CSS so it just seems kind of odd. At any rate, if dimensions are going to be required on text boxes, it would seem to make more sense to have width and height attributes and allow rows and cols as units instead of attributes, that way pixels, ems, et cetera could be used (without CSS); yet another one of my disagreements with the standards.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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