Hi, I'm making my own BBcode and I want to make something that will enter tags like when the user highlights a text they want to add the tags too, like in this forums. I have this script but it enters the tags in front of the text.. <form method="post" name="addcomment"> Comment: <input type="button" onClick="document.addcomment.comment.value+=\'\'" value="Bold" name="bold" title="Add Bold" > <input type="button" onClick="document.addcomment.comment.value+=\'\'" value="Italic" name="italic" title="Add Italic" > <input type="button" onClick="document.addcomment.comment.value+=\'[php][/php]\'" value="PHP Code" name="php" title="Add PHP Code" > <input type="button" onClick="document.addcomment.comment.value+=\'[url=http://linkhere.com]Link text[/url]\'" value="URL" name="url" title="Add Hyperlink" > <textarea rows="5" cols="35" name="comment"></textarea> <input type="submit" name="add_comment" value="Submit"> </form> Code (markup): Thanks in advance .