Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Remove Textbox element ScrollBar

Posted on 2001-08-06
11
Medium Priority
?
477 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 
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 200 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

916 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