Solved

Disable horizontal scrolling of textarea in Netscape 6.2 and above

Posted on 2004-04-07
11
1,868 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
  • 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
 

Expert Comment

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

Greetings
fightbulc
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to dynamically set the form action using jQuery.
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now