Jump to content


Photo

please help *SOLVED*


  • Please log in to reply
1 reply to this topic

#1 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 15 August 2006 - 03:25 PM

I'am quit new to javascript. I've been trying to solve this little problem myself, but...
here is the problem: I'am making a form where user can insert the image (like bbcode); everything works ok, but I don't want the value to show all the html code: <img src="http://www.3d.caucas...ode/smile.gif">, I want to dispaly something like: SMILE or something. Thanks for your help, I really need this:(

function addHTML(smile) {
document.forms['Input Form']['The_Textarea'].value+='<img src="http://www.3d.caucasus.net/pics/bbcode/smile.gif">';
document.forms['Input Form']['The_Textarea'].focus();
}


here is the HTML code for image (works ok):

<img src="../pics/bbcode/smile.gif" width="50" height="49" onClick="addHTML('smile');">
I don't need your script, I'll try to write it myself

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 23 August 2006 - 01:09 AM

Hi there,

Not sure to get it all well, (my english) but,...
Maybe if the "destination" is a div/container, instead of a 'textarea', you could have the expected result,
Something like:
-----------
html part:
<div id="mydiv"></div>
& js part:
document.getElementById('mydiv').innerHTML="<img src='yoursmile.gif' onclick='whatUwant()'>";
-----------
To try,, & hoping it helps,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users