Solved

Remove Textbox element ScrollBar

Posted on 2001-08-06
11
470 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

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…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 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