hammerslane
01-13-2004, 04:14 AM
you know in a reply, when you click the little yellow smilies, it inserts :) or :confused: etc... well i'm basically trying to figure out how to do that.
i hope i'm allowed to use the code from these forums... if not, just let me know.
so far i have this code:<html>
<head>
<script language=javascript>
function smilie(thesmilie) {
// inserts smilie text
document.fieldname.message.value += thesmilie+" ";
document.fieldname.message.focus();
}
</script>
</head>
<body>
<form action="nextpage.php">
<textarea type="textarea" name="description" class="fieldname" rows=6></textarea>
<a href="javascript:smilie(':text to be inserted:')">
<img src="lovelybutton.gif" alt="Insert Text" border="0"></a>
<input type=submit>
</form>
</body>
</html>
the above code doesn't work... can someone tell me if there's an error i've made? (well.. copied... ;))
thanks!
i hope i'm allowed to use the code from these forums... if not, just let me know.
so far i have this code:<html>
<head>
<script language=javascript>
function smilie(thesmilie) {
// inserts smilie text
document.fieldname.message.value += thesmilie+" ";
document.fieldname.message.focus();
}
</script>
</head>
<body>
<form action="nextpage.php">
<textarea type="textarea" name="description" class="fieldname" rows=6></textarea>
<a href="javascript:smilie(':text to be inserted:')">
<img src="lovelybutton.gif" alt="Insert Text" border="0"></a>
<input type=submit>
</form>
</body>
</html>
the above code doesn't work... can someone tell me if there's an error i've made? (well.. copied... ;))
thanks!