Jump to content

please help *SOLVED*


Gruzin

Recommended Posts

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]
Link to comment
Share on other sites

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,,
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.