Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-22-2006, 03:45 AM   PM User | #1
zro@rtv
Regular Coder

 
zro@rtv's Avatar
 
Join Date: Feb 2005
Location: on the network
Posts: 433
Thanks: 0
Thanked 1 Time in 1 Post
zro@rtv is an unknown quantity at this point
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
zro@rtv is offline   Reply With Quote
Old 10-22-2006, 07:49 PM   PM User | #2
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
Arbitrator is on a distinguished road
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.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Arbitrator is offline   Reply With Quote
Old 10-22-2006, 11:14 PM   PM User | #3
zro@rtv
Regular Coder

 
zro@rtv's Avatar
 
Join Date: Feb 2005
Location: on the network
Posts: 433
Thanks: 0
Thanked 1 Time in 1 Post
zro@rtv is an unknown quantity at this point
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
zro@rtv is offline   Reply With Quote
Old 10-25-2006, 12:19 AM   PM User | #4
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
Arbitrator is on a distinguished road
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.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Arbitrator is offline   Reply With Quote
Old 10-25-2006, 08:21 AM   PM User | #5
zro@rtv
Regular Coder

 
zro@rtv's Avatar
 
Join Date: Feb 2005
Location: on the network
Posts: 433
Thanks: 0
Thanked 1 Time in 1 Post
zro@rtv is an unknown quantity at this point
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
zro@rtv is offline   Reply With Quote
Old 10-25-2006, 03:45 PM   PM User | #6
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
Arbitrator is on a distinguished road
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.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Arbitrator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:46 AM.


Advertisement
Log in to turn off these ads.