Quote:
Originally Posted by FaderMonkey
I need some help being pointed in the right direction. You know those buttons on this site that you click to "insert image" or "insert hyperlick" when you are posting? I'm trying to learn how to make those.
For example:
I have a section on my site where people can post. I'd like to make it possible where if someone posting wanted something to be italic they would click a button, a small window would pop up where they would enter what they want italicized, and that would insert the proper italic html tags around their text.
I know this may be pretty complicated, but I just have no idea where to start.
|
HTML stuff:
<form name="myForm">
<textarea name="myTextArea"></textarea>
</form>
<input type="button" name="italicizeButton" onClick="italicize(document.myForm.myTextArea)">
Javascript stuff:
<script language=javascript>
<!--
//pass in the textbox you want to add italicized text to
function italicize(textbox) {
var answer=prompt("Enter text to italicize")
textbox.text += "<i>" + answer + "</i>"
}
-->
</script>