JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 8th, 2003, 01:49 AM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 16
Send a message via AIM to velocityX
javascript insert text to form field

Does anyone know the code so when i click on a picture it will insert certain text into the text area?

** edit: please post in the correct forums. JavaScript is not Java **

Reply With Quote
  #2  
Old August 8th, 2003, 02:43 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 785 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 17
PHP Code:
<html>
<
head>
<
title>Untitled Document</title>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
style type="text/css">
<!--
textarea {
    
borderthin dashed #0066FF;
    
scrollbarsno;
}
-->
</
style>
<
script language="JavaScript" type="text/JavaScript">
function 
sendText(etext)
{
  
e.value text
}
</script>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" bgcolor="#FFFFFF">
<table width="29%" height="292" border="0" align="center" cellpadding="4" cellspacing="2">
  <tr> 
    <td width="100%" height="210" colspan="2" valign="top"> <div align="center"><img name="image" width="300" height="200" onClick="sendText(document.form1.taupdate, 'got it working I see... :)')"></div></td>
  </tr>
  <tr> 
    <td height="80" colspan="2" valign="top"><form name="form1" method="post" action="">
        <div align="center"> 
          <textarea name="taupdate" cols="30" id="taupdate"></textarea>
        </div>
      </form></td>
  </tr>
</table>
</body>
</html> 

Reply With Quote
  #3  
Old August 8th, 2003, 03:03 AM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 16
Send a message via AIM to velocityX
yea works but it resets the form then its puts the text in. I want it to just add the text without modifying existing stuff in the form

Reply With Quote
  #4  
Old August 8th, 2003, 06:51 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to dhouston
Then you'd change the script to e.value += text or, if that doesn't work, e.value=e.value + text.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > javascript insert text to form field


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap