Solved

Disable horizontal scrolling of textarea in Netscape 6.2 and above

Posted on 2004-04-07
11
1,886 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
Industry Leaders: 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!

 

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 125 total points
ID: 10790928
you could write a script that would determine browser type, then use virtual/soft accordingly...  
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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.
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

756 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