This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes TextArea in IE and NS -the no. of characters accepted per line differs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "TextArea in IE and NS -the no. of characters accepted per line differs " Watch "TextArea in IE and NS -the no. of characters accepted per line differs " New topic
Author

TextArea in IE and NS -the no. of characters accepted per line differs

Rhea Karnam
Greenhorn

Joined: May 06, 2003
Posts: 21
How do i make my textarea look/behave the same way in IE and NS?
When i specify cols=20, i expect the text area to accept 20 cols in each row. This is happening the same way in IE (5.5) but not in NS 4.75.
In NS, the textarea accepts only 19 characters per row.
Here's a sample:
<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>
<FORM>
<TEXTAREA rows="5" cols="20" wrap="virtual"
style="font-family : monospace; font-size:10px">
</TEXTAREA>
</FORM>
</BODY>
</HTML>
Any suggestions?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

NS 4 exhibits lots of bizarre behavior. Since the current version of NS is up to 7, why do you care about an ancient browser that's three versions out of rev, and with such low market share? Do you also care whether your pages work in IE3?
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rhea Karnam
Greenhorn

Joined: May 06, 2003
Posts: 21
Hi,
Thanks bear, for the hth. I've taken your advice and eliminated NS4.75 from my list of browsers. But the subsequent problem is that textarea doesn't seem to be working in NS6 at all.
When I use the wrap attribute for textarea, it behaves as expected in IE (any version). But, in NS6.0, it doesn't seem to even recognise the attribute.
Here's my code:
<html>
<form>
<textarea rows="3" cols="25" wrap="hard" >
</textarea>
</form>
</html>
In IE, my display text wraps around neatly after every 25th char. But in NS6, wrapping doesn't happen at all. After the 26th char is input, the textarea grows a horizontal scroll bar, and the line goes on and on.
What I need is a textarea that will accept 25 (and only 25) chars per row.
Please note that I tried replacing "hard" with "physical", "virtual", and "soft" all to no avail.
I need to know
1) whether textareas (with wrap attribute) are recognized by NS6,
2) if I am wrong in expecting NS to wrap the text automatically.
3) in case the answer to the above is yes, can someone help me with a script that would auto-wrap the text?
Desperate to get this problem solved,
Rhea.
P.S. I am doing my bit of research too, but haven't found a solution yet.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6

From: http://www.blooberry.com/indexdot/html/tagpages/t/textarea.htm
This attribute indicates word-wrapping behavior for display and submitted data from the Textarea field.
Values:
Off - No word wrapping to the textarea window occurs - if lines extend beyond the width of the textarea they will not wrap. Lines are sent exactly as typed. DEFAULT in Netscape
Soft - Text is displayed with wordwrapping to the textarea enabled, but these wrap points are not transmitted upon submittal as returns/linefeeds. DEFAULT in Internet Explorer
Hard - Text is displayed with wordwrapping to the textarea enabled, and these wrap points are preserved upon submittal.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TextArea in IE and NS -the no. of characters accepted per line differs
 
Similar Threads
URGENT- - - - Related to Session in JSP
textarea empty tag
JavaScript to Java Applet Comm W/O Plug-in
form problems
teatarea in html