I am currentl working on a web based HTML editor for a php project I am doing. As this is client side it has to be in JAVA I know this is a PHP forum but I have recieved java help on here before.
Here is my scenarios.
I have the following
function addParagraph()
{
var current=document.editor.contents.value
document.editor.contents.value=current+"<strong></strong>"
}
This is only one function, I do have more, on my form I have
<form name="editor" action="<?=$_SERVER['PHP_SELF']?>" method="post"><!-- action="save.php" -->
<p>
<img src="editor_images/Bold.gif" onclick="addBold()" alt="bold" />
</p>
<p>
<textarea name="contents" cols="100" rows="20" wrap="false">
</textarea>
</p>
<p>
<input type="submit" value="Save" />
</p>
</form>
When I click the bold image it inserts , when I select the text i want to be bold it adds after the text. How would I go about wrapping the tags aroung the text if thext is selected.