Re: php text box toolbar



* rf wrote :
* Troy Piggins wrote :

Just wondering if there is php code to use as an exampe that
allows very simple text formatting. That's not the right term,
I'll explain.

I want to have a text box in a form for a web page that has a
toolbar along the top of the textbox. The toolbar is similar to
many forums etc you see that has bold, italics, underline etc
buttons on it. If you highlight a word you've typed in the text
box and hit the bold button, <b> html tags are automatically
added each side of the selected text.

I'd also like it to be able to wrap <a href=""> tags around the
text. If text is selected, click the "link" toolbar button, a
popup appears where you paste the url, click ok and the <a
href="url"> tags are wrapped around the selected text.

It's not important that the text in the text box is displayed in
bold, I just want the html code inserted each side.

Hope that makes sense. I would have thought this is pretty
common for web forms, but I must be searching for the wrong
terms.

It's rich text editing.

http://www.google.com.au/search?q=rich+text+editor

and it is not done simply. The textbox is replaced by an iframe with a huge
bunch of javascript behind the scenes.

In any case it is not a PHP issue. comp.lang.javascript.

Yeah, that's the sort of thing I meant, but I don't want/need the
text in the box to actually be shown bold etc - ie not rich text.
And don't want the drop down boxes - style, font, size, font
colours. Don't even need the right align etc.

Only features I was thinking of was bold, underline, italics, and
the link button.

It doesn't even need to be that pretty. They could just be
normal form buttons.

--
Troy Piggins | http://piggo.com/~troy
.


Quantcast