Solved

Remove Textbox element ScrollBar

Posted on 2001-08-06
11
468 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
In what way are you using the textarea, perhaps there is an alternative we could suggest?

Ant
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:Ernest022699
Comment Utility
(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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks dij8, yup kiwi indeed. very nice site btw.
0
 

Author Comment

by:dog78
Comment Utility
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
Comment Utility
That's just beautiful, nzjonboy. Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

771 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

10 Experts available now in Live!

Get 1:1 Help Now