Text formatting in html forms with javascript?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
justjon
Forum Newbie
Posts: 5
Joined: Tue Mar 30, 2004 10:36 am

Text formatting in html forms with javascript?

Post by justjon »

I'm trying to produce a html form (pretty similar to the one I'm typing in now) where the user can enter a load of text and then format it by making it bold, change colour etc and then store the text and all the formatting in a mysql databases through PHP.

Dose anyone know how to do the formatting bit, is it javascript or some kind of PHP function. Does anyone know of any good tutorials or any pre-written scripts for this purpose?
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

Its got to be javascript unless you want to reload the page for every change. I bet if you google javascript text editing or something you can find some pretty useful scripts
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

No, not really. It can be done just as well or better server-side. No matter what, you need a parser that can detect special character tags you've set up and then replace them with the relevant HTML.

personally, I wouldn't bother writing your own, and just use Textile. http://www.textism.com/tools/textile/
Post Reply