Page 1 of 1

Insert Items each side of selected text - How?

Posted: Wed May 12, 2004 12:56 pm
by XF|Fatalpixel
I am fairly new to this so bear with me.

I have a form where people fill in all sorts of information. I then use FPDF to generate a PDF. All well and good, FPDF, provide an nice HTML parser.

My problem is that some users do not know, or can't be bothered to enter the HTML markup. I am not using much to be honest, just bold, italic and underline.

I want to be able to provide the following.
3 buttons B I U in a word style (no problem)
If a user selects text within the form field and then presses the button...
It inserts, for example, <b> in front of the selected text and </b> after the selected text.

Cant find anything on it. Mostly because no matter what keywords I use for a search it ends up trying to provide me with CMS systems.

All help appreciated...

FPx

Posted: Wed May 12, 2004 1:00 pm
by Weirdan
This forum has this ability (in message editor). It's done via js, so you may open it in text editor and learn from phpbb team work ;)