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.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2009, 02:18 PM
Junior Member
Latest Blog:
None

 
Join Date: 06-19-09
Posts: 3
iTrader: 0 / 0%
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?
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #2 (permalink)  
Old 06-19-2009, 05:00 PM
Contributing Member
Latest Blog:
None

 
Join Date: 12-25-08
Posts: 98
iTrader: 0 / 0%
vipdistinct is liked by many
Is this being used on a WYSIWYG editor? If so you might only be able to insert things into the text box and have then display the correct way if you've used their coding to do that.

If it's not for a WYSIWYG editor then you'll just end up with text in the text box even if you replace it with the image because all you're doing is adding the coding - you need something to render it as if it was an HTML page, which is what the WYSIWYG editor does.
__________________
Your Lifestyle Management and Atlanta Concierge.
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #3 (permalink)  
Old 06-19-2009, 05:18 PM
Junior Member
Latest Blog:
None

 
Join Date: 06-19-09
Posts: 3
iTrader: 0 / 0%
fawk3d is liked by many
its suppose to add the symbols for the smiley in the textbox and its not WYSIWYG its just that little box
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #4 (permalink)  
Old 06-20-2009, 05:12 PM
Junior Member
Latest Blog:
None

 
Join Date: 06-19-09
Posts: 3
iTrader: 0 / 0%
fawk3d is liked by many
what im looking for i the code the gives me the opertunity to click any of the smiley i want into the text box. ok here is an example if i click the "" face then it show a code in the text box like :"P i need to know a code that makes me click a smiley than it appears the ode for the smile like =) =P ect.
Digg this Post!Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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 Off


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


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


All times are GMT -7. The time now is 10:36 PM.
© Copyright 2010 V7 Inc
Powered by vBulletin
Copyright © 2000-2010 Jelsoft Enterprises Limited.


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