Bold, Italic and underline buttons

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

Bold, Italic and underline buttons

Post by Jim_Bo »

Hi,

I have been making a forum, and am wanting to add bold, italic and underline buttons like found in forums to format the text etc .. Whats the easyist way to go about it.


Thanks
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Options Borrow phpbb's js open source system. (Just look at the source)

Write your own.

Find another -- Do a search for bbcode editor.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

What I did for my forums is make a bold, italic, and underline button, when clicked triggers a function to insert [ b ] (example) into the text field. Then I used str_replace to replace all [ b ] 's to <B>.. etc
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

Post by Jim_Bo »

Hi,

I managed to find this:

http://www.iceteks.com/articles.php/javascript/1

It works but you need push bold to get [.b]then type the message, press bold again to close the message[./b]

Anyone know of other code that lets you highlight the code hit bold and have it add the tags to both ends of the text.

Cheers
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

Post by Jim_Bo »

Hi,

Any other suggestions or help ?

Cheers
Post Reply