web_master Posted June 9, 2007 Share Posted June 9, 2007 Hi, I have a <textarea> form. When user insert the text and want to change the SELECTED text attributes how can he do that = I want the simpliest way . Mean like here where I type the text where is a "B" button for a bold, or "I" button for a Italic text... Is there a simpiest way than BBCode? thnx Link to comment https://forums.phpfreaks.com/topic/54849-change-text-style-in-form/ Share on other sites More sharing options...
wildteen88 Posted June 9, 2007 Share Posted June 9, 2007 To convert to <b> you have to use regex. You can do a simple method using str_replace but it is inefficient and not very powerful compared to regex functions (preg_replace). To insert BBcode style tags into a textarea you don't need to use PHP. Instead you use javascript. There is most probably a javascript script already coded for you over at dynamicdrive.com or hotscripts.com. Just each google for BBCode or Javascript BBCode insertion. Link to comment https://forums.phpfreaks.com/topic/54849-change-text-style-in-form/#findComment-271377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.