How to display 'style'ed text in a textaea or... ???

L

lihao0129

The scenario is a RTF(Rich Text Format) editor where I can input text
and meanwhile display 'style'd text or multimedia( i.e bold fonts,
pictures, movies ) in the same box...

I am currently using some HTML tags in textarea and make a "preview"
and a "refresh" button to sync between the writepad(textarea) and the
preview zone(div). But somehow the HTML tags in textarea look messy...
Since text in 'textarea' can not display HTML effects(maybe I was
wrong, please correct me), so I am actually trying to find a way to
both input text and display styles in one box..

Can someone shed some light to me on this problem or point me to some
(concept|term|link)s? really appreciate your time. : - )

Have a nice weekend,
lihao(XC)
 
E

Evertjan.

The scenario is a RTF(Rich Text Format) editor where I can input text
and meanwhile display 'style'd text or multimedia( i.e bold fonts,
pictures, movies ) in the same box...

I am currently using some HTML tags in textarea and make a "preview"
and a "refresh" button to sync between the writepad(textarea) and the
preview zone(div). But somehow the HTML tags in textarea look messy...
Since text in 'textarea' can not display HTML effects(maybe I was
wrong, please correct me), so I am actually trying to find a way to
both input text and display styles in one box..

Can someone shed some light to me on this problem or point me to some
(concept|term|link)s? really appreciate your time. : - )

A quick googling:

How to Create a WYSIWYG Rich Text Editor in JavaScript
<http://www.webreference.com/programming/javascript/gr/column11/index.html>
 
T

Thomas 'PointedEars' Lahn

The scenario is a RTF(Rich Text Format) editor where I can input text
and meanwhile display 'style'd text or multimedia( i.e bold fonts,
pictures, movies ) in the same box...

I am currently using some HTML tags in textarea and make a "preview"
and a "refresh" button to sync between the writepad(textarea) and the
preview zone(div). But somehow the HTML tags in textarea look messy...
Since text in 'textarea' can not display HTML effects(maybe I was
wrong, please correct me), so I am actually trying to find a way to
both input text and display styles in one box..

Pardon me, but your notion of "HTML effects" is nonsense. A textarea is a
*text* area, not a HyperText Markup Language area. Incidently, one commonly
used rich text editor is called HTMLArea. Developing for Zope/Plone, we
(have to) provide another one to our CMS users that is called FCKEditor.
(This was not a recommendation.)

All rich text editors I have seen so far use either frames, iframes or
block-level elements with Gecko's document.designMode="on" or its MSHTML
equivalent (search the MSDN Library).


HTH

PointedEars
 
L

lihao0129

Pardon me, but your notion of "HTML effects" is nonsense.  A textarea isa
*text* area, not a HyperText Markup Language area.  Incidently, one commonly
used rich text editor is called HTMLArea.  Developing for Zope/Plone, we
(have to) provide another one to our CMS users that is called FCKEditor.
(This was not a recommendation.)

All rich text editors I have seen so far use either frames, iframes or
block-level elements with Gecko's document.designMode="on" or its MSHTML
equivalent (search the MSDN Library).

Thank both for all the suggestions. What I really wanted is to write a
WYSIWYG editor of my own. I started it from using 'textarea', so got
that impression. Evertjan's post and the last paragraph of your post
exactly pointed me to some very helpful information..: - )

thanks again,:)
lihao(XC)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top