Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2003, 12:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default TEXTAREA Scrollbar Suppression in HTML or VBScript

I have multi-row readonly textareas on my HTML form. I'd like to suppress the vertical scroll bar that's automatically generated - it's looks bad and doesn't function anyway. Is there a STYLE element I can reference in HTML (I'm NOT using CSS - I'm looking for an element of the STYLE element that can be embedded in the HTML itself) or a way to reference the field from VBScript that would remove the scroll bar?
 
Old June 18th, 2003, 01:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I'm afraid that you misunderstand what the HTML "style" is a little. The style attribute itself is HTML. But its value is CSS. What you are looking for is "overflow: hidden" or safer "overflow: auto". Which is CSS. :)
http://www.w3.org/TR/REC-CSS2/visufx...opdef-overflow

But CSS can be used inline with help of the style attribute.
http://www.htmlhelp.com/reference/css/style-html.html

So:
<textarea style="overflow: auto">

Works in IE and Moz based browsers but not in Opera (I think). This is very clumsy though, compared to a linked style sheet or at least an embedded style block if you use CSS in more than one or two places.

(o<
//\ =^..^=
The Following User Says Thank You to meow For This Useful Post:
Ron Howerton (February 22nd, 2013)
 
Old June 18th, 2003, 02:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

I suppose I do misunderstand "style" in all its various incarnations. As a VB programmer, I'm used to simply referencing a property to set a state and having to know all the various possible properties and values and what they mean (what does "overflow" have to do with scrolling, for example - in VB it couldn't be more intuitive, I simply reference a Scroll property) isn't an issue. Using HTML is like programming in the days before windows!

In any case, though, you have solved my problem and without forcing me to create a Style Sheet (considered a no-no here) or do it Java. Browser based limitations aren't an issue for me - we're all on IE here. Thanks!
 
Old June 18th, 2003, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Ah, but HTML isn't programming. CSS is more command like in its structure though. It's just that you have to know what you look for. No overflow = no scrollbars. Clear as crystal! :D

BTW, think of CSS more like RegExp. You write a rule that matches a structure throughout your document(s). When you don't inline it, of course.

(o<
//\ =^..^=
The Following User Says Thank You to meow For This Useful Post:
Ron Howerton (February 22nd, 2013)
 
Old June 18th, 2003, 02:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

If I'm understanding you correctly then, if I'm doing this repeatedly, I should create a stylesheet and the values supplied will apply to all of the referenced objects? IOW, I would set the overflow element once and it would be automatically applied? In this instance, I'm not sure it makes much of a difference because the HTML is being generated by ASP VB, but I can see where this might come in handy when laying out complicated forms by hand.

Thanks again for your assistance. More often than not, my problem is just figuring out WHAT to search for - hence the complaint about non-intuitive keywords.
 
Old June 18th, 2003, 02:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Yes, that is correct. In more pure CSS it could look something like this:

/* Applies to all textareas */
textarea { overflow: auto }

/* Applies only to textareas with the class foo */
textarea.foo { overflow: auto }

/* Applies to all and any element with the class foo (if applicable) */
.foo { overflow: auto }

/* Applies only to textareas that is contained within an element with id bar */
#bar textarea.foo { overflow: auto }

Looking more appetizing now? :)I think something can be gained even if the bulk of the markup is generated server side. You don't need to go in and change your script just because you want to change how something looks for instance. Change one line - change your whole site.

(o<
//\ =^..^=
The Following User Says Thank You to meow For This Useful Post:
Ron Howerton (February 22nd, 2013)
 
Old June 18th, 2003, 02:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Unfortunately CSSs are frowned upon bcause of difficulty caused with Assitive Technology applications. But for my personal projects, I could see where CSSs might come in handy, such as in the example you provided. Thanks again!
 
Old January 8th, 2007, 02:02 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to sirNemanjapro Send a message via AIM to sirNemanjapro Send a message via MSN to sirNemanjapro
Default

Thanks a milion for that tip meow!

Oh, and one more thing, the overflow dose not work on Opera v9.02, I am currently downloading v9.10. I will post results.

I have nothing to say.

EDIT:

It dose not work in Opera v9.10 either.
The Following User Says Thank You to sirNemanjapro For This Useful Post:
Ron Howerton (February 22nd, 2013)





Similar Threads
Thread Thread Starter Forum Replies Last Post
write HTML into TEXTAREA using PHP anshul PHP How-To 6 March 27th, 2009 12:15 PM
Create ScrollBar for HTML DIV Adawi VB How-To 3 March 26th, 2008 10:05 AM
TEXTAREA tag in html sapphire87 PHP How-To 0 July 26th, 2006 02:25 PM
html:select scrollbar somsahi Struts 0 July 24th, 2006 05:53 PM
html textarea to DB ginoitalo Beginning PHP 1 May 30th, 2005 01:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.