Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 06-19-2009, 03:18 PM   #1 (permalink)
Junior Member
 
Join Date: 06-19-09
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

fawk3d is liked by many
Post Javascript Help (replacetext)

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?
fawk3d is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypt Javascript - Secure Your Javascript Code ZunuZunu Services 7 03-09-2009 01:55 PM
Javascript help.. VsUK Coding Forum 6 02-08-2009 08:30 AM
Count-up from a particular year + Javascript within Javascript? Help! Azam.biz Coding Forum 3 06-06-2005 07:47 AM
I need some help with JavaScript. Can anyone help me please? CrAg Coding Forum 2 03-22-2004 05:56 AM
javascript webmaster@lostinteardrops Coding Forum 16 10-31-2003 08:19 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:26 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.