Gruzin Posted August 15, 2006 Share Posted August 15, 2006 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: [color=red]<img src="http://www.3d.caucasus.net/pics/bbcode/smile.gif">[/color], I want to dispaly something like: SMILE or something. Thanks for your help, I really need this:([color=green]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();}[/color]here is the HTML code for image (works ok):[color=red]<img src="../pics/bbcode/smile.gif" width="50" height="49" onClick="addHTML('smile');">[/color] Quote Link to comment Share on other sites More sharing options...
GBS Posted August 23, 2006 Share Posted August 23, 2006 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,, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.