Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member BigBeagle's Avatar
    Join Date
    Feb 2009
    Posts
    2
    Member #
    18337
    Hello,

    I'm having a problem with some textareas on my page. By textarea, I mean the actual form element, not just a text region.

    What I want to do is display a list of words and definitions, something of the form:

    word1 -- pronunciation -- definition
    word2 -- pronunciation -- defintion1, definition2, definition3
    word3 -- pronuncation -- defintion

    and so on.

    Ideally, this is how it would show up, with line breaks only where the user actually hits the return key. Instead, when an entry (like word 2 above) exceeds the width of the textarea, I get something like:

    word1 -- pronunciation -- definition
    word2 -- pronunciation -- defintion1, definition2,
    definition3
    word3 -- pronuncation -- defintion

    For my purposes, this is kind of ugly. What I would like instead is for the textbox to simply produce a horizontal scrollbar.

    I've found that going inside the tag and setting the wrap attribute to "off" will accomplish this. However, because this html is auto-generated by a framework, this isn't actually useful in production. I'm supposed to adjust this sort of thing with style sheets. But so far, I've come up empty on anything that will work in CSS.

    Does anyone have any ideas? Thanks.

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Seems like there's no good way of doing this with CSS. [minicode]white-space: nowrap;[/minicode] and [minicode]white-space: pre;[/minicode] work in a few browsers (Opera, for example), but not consistently enough. The best solution would, sadly, be one based on Javascript that assigns the wrap attribute.

    You could make this something that happens only if the CSS is verified to have the relevant white-space attribute, which would make it essentially observe your CSS for the appropriate attribute, letting you mostly configure it via CSS.

  4. #3
    Senior Member jyuill's Avatar
    Join Date
    Jan 2009
    Location
    California
    Posts
    145
    Member #
    18049
    I don't know if you mean when the user is actually filling out the form, or when the form is submitted. If it is just the filling out, just define the text area in your CSS as
    textarea
    {
    overflow: scroll;
    }
    If you mean when it is submitted...??? not really sure depends on what/where/how you are submitting it?
    Semantic, Valid, and Accessible Design!


  5. #4
    Senior Member jyuill's Avatar
    Join Date
    Jan 2009
    Location
    California
    Posts
    145
    Member #
    18049
    Quote Originally Posted by jyuill
    I don't know if you mean when the user is actually filling out the form, or when the form is submitted. If it is just the filling out, just define the text area in your CSS as
    textarea
    {
    overflow: scroll;
    }
    If you mean when it is submitted...??? not really sure depends on what/where/how you are submitting it?
    But apparently that doesn't work in IE...I'm sorry!!!:-\
    Semantic, Valid, and Accessible Design!


  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yes, unfortunately overflow: scroll shows the scrollbars, but doesn't actually turn off word wrapping, so it doesn't help much. Very silly that it's so damn hard, but there you have it.

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Let's start with a more basic question... why does it have to be a textarea?

  8. #7
    Junior Member BigBeagle's Avatar
    Join Date
    Feb 2009
    Posts
    2
    Member #
    18337
    Quote Originally Posted by smoseley
    Let's start with a more basic question... why does it have to be a textarea?
    Well, it definitely has to be a text area for when the user is entering or editing their information. (This is a quiz-type program). During the actual quiz part, I suppose I could use something else. I've been avoiding that so far since I had hoped to present a consistent appearance across the site. But I suppose this might force my hand for using something else.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com