Solved

Remove Textbox element ScrollBar

Posted on 2001-08-06
11
469 Views
Last Modified: 2008-02-01
How can the scrollbar of the <TEXTBOX> element be removed?
0
Comment
Question by:dog78
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6355766
You mean <textarea>?

Well if the text within the textarea is too much to show then the browser will automatically add a scrollbar.

As far as I know there is no way of stopping that.

Ant
0
 

Author Comment

by:dog78
ID: 6355855
Sorry, yes, <TEXTAREA>.

The textbox is currently empty. Yet it draws a shadowed scrollbar (just like the Comment Input box here on this site). Is there a way to remove that?
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6355867
Only in some browsers - for example I'm using Opera and there is no scrollbar at all (unless it needs one).

Are you using Netscape by any chance?

Again, I'm pretty sure the answer is "no". Sorry.

Ant
0
 

Author Comment

by:dog78
ID: 6356062
I'm writing this for use on the Active Desktop. So, I guess that would be considered IE. Do I have other options for a large input area without a scrollbar? I'm looking for the ability to control the styles of the input form, and TextArea allows this.
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6356099
In what way are you using the textarea, perhaps there is an alternative we could suggest?

Ant
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:Ernest022699
ID: 6356741
(Sigh) Browsers are designed for ease of use by end users.  Leave the scrollbars alone; people expect their browsers to behave the way THEY like them, not as some developer thinks the screen should look.

HTML is for providing content, not managing screen design.
0
 
LVL 3

Accepted Solution

by:
nzjonboy earned 50 total points
ID: 6357285
dog78, there is a work around for this. what you can do is set the overflow property for the textarea to hidden, this will remove the scroll bars in ie. then al you need is a a script to check the number of characters entered do not exceed the limit of what is visible. heres and example

<html>
<head>
<script language="javascript">
   function textCounter(field, maxlimit) {
          if (field.value.length > maxlimit) {
               field.value = field.value.substring(0, maxlimit);
          }
   }
</script>
<style>
     textarea {
          overflow:hidden;
     }
</style>
</head>
<body>

<textarea name="text1" cols=50 rows=2 onKeyDown="textCounter(this,100);" onKeyUp="textCounter(this,100);"></textarea>

</body>
</html>

hope this helps

nzjonboy
0
 
LVL 10

Expert Comment

by:dij8
ID: 6357598
nzjonboy (fellow kiwi per chance?), you beat me to it.

To confirm, the way to do this is in fact using the style overflow=hidden.  It is IE only.  Nice touch with the character count nzjonboy.
0
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6357635
thanks dij8, yup kiwi indeed. very nice site btw.
0
 

Author Comment

by:dog78
ID: 6359544
Ernest, I share in your view. I do not agree with websites which take too much control of the browser. However, I'm working on code which is to be used on the -desktop- as a background. The intended audience would be the few employees here at the office. I simply wish to remove the scrollbar because there will never be more than a screen full of text. I know this, so I wish to remove the unnecessary scrollbars. If I can't do that, I'll try to style them so that they'll at least match the background, but removal would be best.
0
 

Author Comment

by:dog78
ID: 6359573
That's just beautiful, nzjonboy. Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

15 Experts available now in Live!

Get 1:1 Help Now