adam84 Posted August 28, 2008 Share Posted August 28, 2008 I have formatting buttons over top of a text area. When a user clicks on a button, I want to add the corresponding html tags around the selected text. Just like the 'start new topic' and 'reply' pages on this site. all I have been able to do is once I click the button, I can add the tag just to the end of the current string in the textarea. Any ideas? Link to comment https://forums.phpfreaks.com/topic/121753-what-to-do/ Share on other sites More sharing options...
emehrkay Posted August 28, 2008 Share Posted August 28, 2008 http://www.quirksmode.org/dom/range_intro.html sprinkle a lil regex around the selection and there you go Link to comment https://forums.phpfreaks.com/topic/121753-what-to-do/#findComment-628138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.