Smiley Click picker using Javascript and FORM woes .. Please help...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

OK im prety much a newbie at PHP but it has me hooked.

Im writing a comment system for one of our modules on phpnuke. Its all
going very well, well should i say WAS going very well :)

Ok all the comments work etc and everything is intergrated nicely in the
database. Now im parsing the comments back out to the user and replacing
string like :) with emoticons etc. It works perfectly and i'm seriously
pleased with myself (ok ok remember i said i was new at this :) .....

Now the issue i have is a silly one. I want to present the form input
for the comments in pretty much similair ways to phpbb does on a new
post. I.e present BBCODE icons and smileys that can be clicked and it
inserts into the FORM field ... I have a working javascript that does
just that but try as i might the darn thing will NOT wrap a FORM (even
if wrapping is on). This seems more a MOZILLA problem than IE ( wraps in
that). So if i keep on hitting the same icon again and again it will not
wrap and presents a scrollbar that keeps on going. The actual FORM will
wrap if i insert text inside it manually however so maybe its a
javascript error after all ??

Anyway im hoping someone somewhere can shed some light on this. Here the
test code.
<meta content="text/html; charset=ISO-8859-1"
<script type="text/javascript">
function addsmiley(code)
var pretext =;
this.code = code; = pretext + code;
<b>Comment on this movie:</b>
<form name="comment" method="post" action="news.php"> <textarea
name="post" wrap="hard" rows="8" cols="30"></textarea></form>
<img src="../../forum/images/smiles/icon_biggrin.gif" alt=":)"
onclick="addsmiley(':)')" style="border: 0px solid ; width: 15px;
height: 15px; cursor: pointer;">
Ive tried setting WRAP to Virtual / HARD / SOFT / Physical etc and it
still insists on not wrapping from the javascript ... Anyone any ideas ???

Site Timeline