fl00d
05-18-2008, 03:46 AM
Hi,
I've got a problem with text area's. Specifically the way they handle text. My problem is that I can't find a good way for the text in a text area to automatically switch to a new line after a certain length is met, and keep proper formatting.
Say I've got a normal text area
<textarea></textarea>
when typing into that, the text goes on and on and on and on and on... always augmenting the horizontal scrollbar. I found a property called WRAP and it wraps the text to the width of the text area, which is fine and dandy. However, when submitted and stored in the database, the text keeps the style of the text area.
I've got a text box 300px wide. The page for my site is let's say 500px wide.
I type into the text area, and at the end of 300px a new line is automatically created. When I submit the form, the data is kept in the db. However, it keeps its 300px width. When the info is recalled from the db to be displayed on my 500px wide page, it's formatted as 300px wide when I want it to fill the full width of the page.
So what I'm looking for is a method that after 300px or x amount of length, the text area will automatically move to a new line BUT when it's called back from the database, it will fill the full page. Am I making sense?
Perhaps it would be clearer with the real example.
http://www.ridemtl.com/articles/view/3/
See there, the text doesn't fill the whole page?
I'm trying to think/find a Javascript solution, but I'm not experienced with JS so I haven't turned anything up. Perhaps something with the on.keydown function will work :confused:
Thanks
-CMC
I've got a problem with text area's. Specifically the way they handle text. My problem is that I can't find a good way for the text in a text area to automatically switch to a new line after a certain length is met, and keep proper formatting.
Say I've got a normal text area
<textarea></textarea>
when typing into that, the text goes on and on and on and on and on... always augmenting the horizontal scrollbar. I found a property called WRAP and it wraps the text to the width of the text area, which is fine and dandy. However, when submitted and stored in the database, the text keeps the style of the text area.
I've got a text box 300px wide. The page for my site is let's say 500px wide.
I type into the text area, and at the end of 300px a new line is automatically created. When I submit the form, the data is kept in the db. However, it keeps its 300px width. When the info is recalled from the db to be displayed on my 500px wide page, it's formatted as 300px wide when I want it to fill the full width of the page.
So what I'm looking for is a method that after 300px or x amount of length, the text area will automatically move to a new line BUT when it's called back from the database, it will fill the full page. Am I making sense?
Perhaps it would be clearer with the real example.
http://www.ridemtl.com/articles/view/3/
See there, the text doesn't fill the whole page?
I'm trying to think/find a Javascript solution, but I'm not experienced with JS so I haven't turned anything up. Perhaps something with the on.keydown function will work :confused:
Thanks
-CMC