|
-
Jun 12th, 2001, 08:59 AM
#1
Thread Starter
New Member
javascript - click graphic to enter text into textarea
Could someone explain how to...
Hmm, I see the smilies here do what I'm wanting to do, but I don't understand the code.
I'm wanting to do something exactly like on the response page on this forum, where you click the smiley face and it enters the code for it into the textarea. (But it's for another feature, not smilies.)
Could someone give a brief explanation of the coding needed to do this?
I'm seeing the javascript:smilie(':)') in the href tag, but I don't see how it is specifying where to place the text. I know there's gotta be more to it than that!
-
Jun 12th, 2001, 09:15 AM
#2
the function is probably something like this
Code:
function smilie(smile)
{
document.formname.textboxname.value = document.formname.textboxname.value + smile;
}
you would just replace formname with the name of your html form element and textboxname with that name of the textbox
and in the onclick attribute for the img element put
onclick="javacript:smilie('text to add')"
-
Jun 13th, 2001, 01:25 AM
#3
Thread Starter
New Member
'Kay
Thanks. That makes a lot more sense!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|