?
Solved

Disable horizontal scrolling of textarea in Netscape 6.2 and above

Posted on 2004-04-07
11
Medium Priority
?
1,903 Views
Last Modified: 2012-06-27
I have a textarea for which when the text exceeds the length of the textarea the text should come down to the next line without any horizontal scroll bars appearing. This is the default behaviour in IE but in Netscape whenever the text exceeds the length of the textarea, horizontal scrollbars appear (which i do not appear).Please advise.
0
Comment
Question by:srnambiar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
11 Comments
 
LVL 2

Expert Comment

by:dgooding
ID: 10774736
http://www.htmlref.com/reference/appa/tag_textarea.htm
 
IE - wrap="off | physical | virtual"
NS - wrap="hard | off | soft"

In some versions of Netscape and Microsoft browsers, this attribute controls word-wrap behavior. A value of off for the attribute forces the <textarea> not to wrap text, so the viewer must manually enter line breaks. A value of hard causes word wrap and includes line breaks in text submitted to the server. A value of soft causes word wrap but removes line breaks from text submitted to the server. Internet Explorer supports a value of physical, which is equivalent to Netscape's hard value, and a value of virtual, which is equivalent to Netscape's soft value. If the wrap attribute is not included, text will still wrap under Internet Explorer, but older versions of Netscape, notably Netscape 4, will scroll horizontally in the text box. Given this problem, even though it is nonstandard, it may be a good idea to include the wrap attribute.

<textarea name="comment" rows="10" cols="40" wrap="virtual" align="center"></textarea>
0
 

Expert Comment

by:fightbulc
ID: 10774870
Hi,

just use the "wrap"-attribute for the textarea. I.E.:
<textarea name="virtual" cols="30" rows="3" wrap="virtual">

This breaks automaticly the line at the end of the textarea.
There are 4 values for the wrap-attribute: soft, hard, virtual and physical.
Soft and Virtual are the same, the difference is that soft only works for netscape. Virtual works also for IE4+ and NS2+.
The same thing for hard and physical. And if you send this textarea to a formular, hard and phsical will send also the linebreaks. Soft and Virtual wont do this!

Netscape developed this attribute to break lines in textareas.
But this is not W3C conform, cause for the W3C the lines should break automaticly without any attributes!

Hope I could help.
Bye fightbulc

0
 
LVL 1

Expert Comment

by:ch3rryb0mb
ID: 10779949
could you just say add an attribute "hscrolling=0" or no or something like that. i dunno just a thought.

gl
-char
0
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

Expert Comment

by:fightbulc
ID: 10782021
Nope, there is no attribute like this.

Greetings
fightbulc
0
 

Author Comment

by:srnambiar
ID: 10783001
The wrap attribute is not working in Netscape 7 - The horizontal scroll bars still appear even if I set wrap="soft" or wrap="hard" . My main intention is to get rid of these horizontal scroll bars in Netscape and instead get the vertical scroll bars when text exceeds the length of the textarea.
0
 
LVL 2

Expert Comment

by:dgooding
ID: 10783132
http://www.web-wise-wizard.com/html-tutorials/html-form-forms-textarea-wrap.html

Go here and find the type of textbox you're after.  (My guess is "virtual").
0
 
LVL 1

Expert Comment

by:ch3rryb0mb
ID: 10787851
ha, ok ,well there should be

peace
-char
0
 

Author Comment

by:srnambiar
ID: 10790853
Netscape 7 does not adhere to the formatting applied by the wrap="virtual" atrribute.
0
 
LVL 2

Accepted Solution

by:
dgooding earned 500 total points
ID: 10790928
you could write a script that would determine browser type, then use virtual/soft accordingly...  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question