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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post

    textarea problems in IE and Mozilla

    I have two problems.

    1. Why did the rows attribute change from IE 5.0 to IE 6? In IE 6, rows="4" gives you 3 rows while it gave the correct amount in IE 5.0. This is a hazard when it comes to compatibility.

    2. If I make a textarea in Mozilla, it's always bigger than the rows allocated. It can hold 6 rows when I tell it 4. And it also doesn't wrap.

    Which one of these is standard? Is there any workarounds for this? Or is the textarea tag doomed from this point on?

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post
    I've done some searching and here's all I found:
    http://www.w3.org/MarkUp/1995-archiv.../TEXTAREA.html. (Now that's an old looking page for the W3).

    I have a textarea that expects 16 numbers ranging from 1 to 8 (it's validated by a regexp). It's 4 rows and 4 columns.

    In Mozilla, when you type text into a textarea that has those limitations, it will not wrap. Why is this?

    But in Internet Explorer 5, cols="4" means 4 columns. But in Internet Explorer 6, cols="4" means 3 columns and a scrollbar that takes up a whole column (even if it's disabled or not used).

    What is the solution? This tag is not depricated but it's support among browsers is very loose and unpredictable. The W3 doesn't have any up-to-date info on this tag let alone a set of rules the browsers should be following. Does anyone have a recommendation for this?

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Just a wild guess...but why not define your textarea with css plus overflow:auto. Or maybe try to increase the cols and rows until you know what Moz's wrap limitation is...
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't use rows or cols attributes at all. I leave them out, and define the dimensions in CSS.

    Modern browsers handle that fine, and I've never had any wrapping problems in any browsers, without definining any overflow CSS or using non-standard "wrap" attribute values. It should just work.

    Browsers with no CSS support will render it at a default size, which is usually quite small, but nonetheless useable - unless you're using the textarea for visual formatting, but if so you should be using a <pre> block and not <textarea>
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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