File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Please help with textarea formatting issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Please help with textarea formatting issues" Watch "Please help with textarea formatting issues" New topic
Author

Please help with textarea formatting issues

Sam Walker
Ranch Hand

Joined: Nov 06, 2002
Posts: 65
Hi All,
I�m having some strange problems with textarea tags. I find it almost impossible to enforce a consistent look across browsers for textarea even though I specifically impose a style.
<textarea class="simpleText" name=exhibit_text wrap="physical" cols="60" rows="12" value="<%= exhibit %>"

cols="60" works fine for IE but NS 6 showed the columns huge so I specifically made the columns 30 when dealing with NS6. Now I�m testing with NS 7 and all the columns are pitifully small. Is there a way to enforce column width without coding for every browser and every version?

A second problem is that some blank spaces are inserted in the textarea. Even when I initialize the content of a textarea with my data, a chunk of blank spaces gets appended to the end. How can I remedy this? I am already using a JavaScript to remove blanks from the beginning of a textarea, do I need to do the same for the end?
And the wrap doesn�t work. I expected wrap=�physical� would actually would insert a newline in a long line and send it the server that way. That does not appear to happen in my testing. When I access the line again from the server and display it in a paragraph the line appears as one long line.

I�ve been looking everywhere for information how to deal with these, all I find is the basic elementary stuff.
Your help is greatly appreciated
[ June 12, 2003: Message edited by: Sam Walker ]
[ June 12, 2003: Message edited by: Sam Walker ]
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
Sam,
Actually text area doesnt have a attribute "value"
so remove that and check.u have to write
<%= exhibit %> after text area tag.
I cheked in ns 6 and didnt find any probs i eman
ie and ns 6 and 7 behaved the same way
Then regarding the spaces in ur js include a fn cut the trailing space also i mean fn for both trailing and leading.
I had a js like that somewhere in my pc. if u having probs i will check
Sam Walker
Ranch Hand

Joined: Nov 06, 2002
Posts: 65
Hi Sunitha,
Thanks for the suggestions. I do need to clean up my scripts including what you suggested. My experience has been that even when there�s nothing to initialize the value attribute the column sizes are different on different browsers. I�m going to check out to see what happens after value is removed.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

The wrap attribute is not part of the HTML 4 standard and so browsers apply their own meanings to it, if they support it at all.
To enforce a standard width, you might want to try applying a CSS width attribute that specifies the width in pixels rather than "columns" (whose width, as you have discovered, is up to browser interpretation).
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sam Walker
Ranch Hand

Joined: Nov 06, 2002
Posts: 65
Should I then remove the col attribute from textarea tags or use it together with CSS width?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Blow it away.
bear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help with textarea formatting issues