Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add to Textarea when clicking on a image

Status
Not open for further replies.

Naits

Programmer
Oct 10, 2001
90
NO
How can i add text to a textarea when users are clicking on a image? __________________
Visit my homepage
.: Game universE :.
 
<img src=&quot;img.jpg&quot; onClick=&quot;javascript:document.formName.textArea.value=document.formName.textArea.value + 'text';&quot;> &quot;The surest sign that intelligent life exists elsewhere in the universe is that it has never tried to contact us&quot;
Bill Watterson, Calvin & Hobbes
 
check this out,

the scripting:
Code:
<script language=javascript>
<!--
function addSrcToBox(img){
document.txtAreaForm.txtArea.value+='\n'+img.src;
}
-->
</script>

and the HTML:
Code:
<form name=txtAreaForm>
<textarea name=txtArea rows=10 cols=50></textarea>
</form>

<img src=&quot;someImage.gif&quot; onMouseDown=&quot;addSrcToBox(this);&quot;>


try that for ya!
Robert Carpenter
questions? comments? thanks? email me!
linkemapx@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
n/p
Robert Carpenter
questions? comments? thanks? email me!
linkemapx@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top