im looking for a little help with adding smileys in the textbox when clicking on them. i have tried looking on the net to find out but it seems like its not what im looking for or what to search for
This is the smilies i want to be clicked and end up in the text box
this is the code
Code:
<script type="text/javascript">
/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0)
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}
function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
</script>
and
Code:
<center><p><b><a href="#" onClick="return overlay(this, 'subcontent2', 'center')">Show/hide smilies</a></b><br /></p><center>
<!--Do not remove outer most DIV tag with id="subcontent2"-->
<DIV id="subcontent2" style="position:absolute; display:none; border: 2px solid black; background-color: lightyellow; width: 300px; height: 200px; padding: 0px">
<font color=black><center><sub><a href="javascript://" onclick="replaceText(' :D ', document.form.message); return false;"><img src=images/smiles/icon_biggrin.gif alt=":D" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :lol: ', document.form.message); return false;"><img src=images/smiles/icon_lol.gif alt=":lol:" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :) ', document.form.message); return false;"><img src=images/smiles/icon_smile.gif alt=":)" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' ;) ', document.form.message); return false;"><img src=images/smiles/icon_wink.gif alt=";)" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :P ', document.form.message); return false;"><img src=images/smiles/icon_razz.gif alt=":P" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :strangegrin: ', document.form.message); return false;"><img src="images/smiles/icon_strangegrin.gif" alt=":strangegrin:" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :tooth: ', document.form.message); return false;"><img src="images/smiles/icon_tooth.gif" alt=":tooth:" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' 8) ', document.form.message); return false;"><img src=images/smiles/icon_cool.gif alt="8)" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :o ', document.form.message); return false;"><img src=images/smiles/icon_surprised.gif alt=":o" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' :rolleyes: ', document.form.message); return false;"><img src="images/smiles/icon_rolleyes.gif" alt=":rolleyes:" width="15" height="15" border="0"></a>
<a href="javascript://" onclick="replaceText(' 8| ', document.form.message); return false;"><img src="images/smiles/icon_eek.gif" alt="8|" width="15" height="15" border="0"></a>
</center></font>
<div align="right"><a href="#" onClick="overlayclose('subcontent2'); return false"><font color="#000000">Close</font></a></div>
</DIV>
but i belive its somethings missing

anyone who can help me out abit?