Solved

Disable horizontal scrolling of textarea in Netscape 6.2 and above

Posted on 2004-04-07
11
1,895 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

691 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