Wrox Programmer Forums
|
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 May 31st, 2004, 10:40 AM
Authorized User
 
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Textarea problem

Hi,

How does one modify the font etc. in a text area.

I want to display bold italic etc. however I do not want to use one of those editors as they will display the formating buttons which i dont want.

I simply want a static text area with different font colors and sizes. Thats all - nothing else Any idea to how to go about doing this?

Your help is greatly appreciated.

 
Old May 31st, 2004, 10:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this...
Code:
<html>
<head>

<style>
    TEXTAREA { font-family:verdana; font-weight:bold; }
</style>

</head>

<body><textarea>some text</textarea></body>

</html>
Hope it helps

Jacob.
 
Old May 31st, 2004, 11:24 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

What do you mean you want to display bold/italic/underline without formatting buttons?

HTH,

Snib

<><
 
Old May 31st, 2004, 11:40 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I guess I misunderstod. You are talking about these editors used in e.g. this forum, and you do not like the buttons, so you want a way to do it without the buttons, right?!

I think you have to make the question more detailed.

Jacob.
 
Old May 31st, 2004, 12:49 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

This isn't possible with a textarea field. Only one style can be set for the entire field. You're going to need a crapload of javascript and something like overflow: auto; to emmulate a <textarea> on a <div> element, whereas you can edit to your heart's delight, adding features for bold, italic, font size etc (although I don't know how you intend to do this without buttons?). Its a pretty large project and quite outside the scope of P2P. I'd do some googling for WYSIWYG editors.
http://www.google.com/search?q=WYSIWYG+JavaScript

If you've noticed P2P itself only uses BBcode and a textarea field to accomplish this.

Many solutions available are microsoft IE only solutions, but it is possible to code a cross-browser WYSIWYG editor, and even without an <iframe>.

HTH!

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old May 31st, 2004, 02:47 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I personally like HTMLarea.

http://google.com/search?q=htmlarea

HTH,

Snib

<><
 
Old June 2nd, 2004, 06:51 AM
Authorized User
 
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Guys,

Thanks Richard. Maybe I am on the wrong track.

Basically, I need to fit a lot text with pictures and other graphics into a small area. This what I need.

So I thought that a scrollable textarea would be good. However, as you say the project is too much work, can you recommend me any other solutions to go about doing this?

Thanks a bunch



 
Old June 2nd, 2004, 10:56 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Textareas (and our suggestions) are editable. Do you want that?

If not, you can put HTML in a <div> and set the overflow property to scroll.

....
<div style="overflow:scroll">
your images, any HTML stuff
</div>
....

HTH,

Snib

<><
 
Old June 7th, 2004, 10:07 AM
Authorized User
 
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Guys,

Found a way using <iframes> however now I am stuck on another problem. How does one remove the horizontal scrollbars on <iframes>. I seem to have tried various codes like

body { overflow-x:hidden; }

 but none of them seem to work.

Any suggestions..?

 
Old June 8th, 2004, 12:29 AM
Authorized User
 
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey everyone,

I found a way by setting the body width of the source page to 95%. Problem solved.

body { width=95%; }

Thanks for all your support.






Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript textarea problem with FireFox dparsons Javascript How-To 0 May 19th, 2008 08:34 PM
Problem with Textarea ksrmramu Javascript How-To 4 August 25th, 2005 11:47 AM
display vbCrLf's from textarea to textarea mat41 Classic ASP Basics 8 June 10th, 2004 12:19 AM
ASP: Textarea Problem when updating DB seala Access ASP 1 June 13th, 2003 12:35 PM





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