SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
-
Jun 5, 2003, 15:14 #1
onClick insert a text in a text area
Hi there,
I've been searching for this function to complete my script. In brief I want to have a text area where I can write anything in it. And beside it I want to have a picture or a botton and if I clicked that botton it inserts a text in the text area. The idea is similare to the clickable smilies in this forum. Is there any pice of code that I can use to do this job to me?
Any help would be appreciated in advance
-
Jun 5, 2003, 16:17 #2
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Simple example:
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>Title</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript"> function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.innerHTML += text; } </script> </head> <body> <form> <textarea id="txt1"></textarea> <input type="button" value="Insert some text" onclick="insertText('txt1', 'Hello');"> </form> </body> </html>
-
Jun 6, 2003, 09:27 #3
Thanx jofa that worked just FINE
How about the script that is used to post an image code in my post at this forum? I mean the prompt script which gives you the ability to add an image code in your post...May I have that pice of code too?
Thanx in advance
-
Jun 6, 2003, 09:29 #4
-
Jun 6, 2003, 10:19 #5
That's cool but where can get the source code? I tried to view it's source using the notepad But it didn't worked fine.
May I have that source for the TAEditor???
-
Jun 6, 2003, 10:22 #6
okay thanx alot beetle I found my mistake. now it's working just great thank youuuuuuuuuuuuuu
-
Jul 12, 2003, 07:34 #7
Hey jofa can I change the button into an image?? I tried to do it but I failed..plz
Thanx
-
Jul 14, 2003, 05:51 #8
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<input type="image" ...> maybe?
Or just an <img> with an onclick event handler added
-
Jul 14, 2003, 06:14 #9
-
Jul 14, 2003, 06:16 #10
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
...if you don't return false ?
-
Jul 14, 2003, 06:17 #11
-
Sep 10, 2003, 08:02 #12
It didn't work and you can try that jofa
I simply need a smily system just like the one in here...
Thanx for the help
Bookmarks