Jump to content

Insert into focused textarea


janroald

Recommended Posts

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--][b]Use onfocus to track the current focus:[/b]
the events [i]onfocus[/i] and [i]onblur[/i] can now be used with every element. There is no standard DOM interface to get the current document focus, so if you want to track that you'll have to keep track of it in a JS variable. [/quote]

Taken from [a href=\"http://www.mozilla.org/access/keyboard/tabindex\" target=\"_blank\"]mozilla site[/a]

So if you're already setting a function for the onfocus event for the textareas, add a function call that stores the id in a variable, and then use this in a getElementById in your insert function.
Link to comment
Share on other sites

[!--quoteo(post=345613:date=Feb 14 2006, 12:23 PM:name=Javizy)--][div class=\'quotetop\']QUOTE(Javizy @ Feb 14 2006, 12:23 PM) [snapback]345613[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Taken from [a href=\"http://www.mozilla.org/access/keyboard/tabindex\" target=\"_blank\"]mozilla site[/a]

So if you're already setting a function for the onfocus event for the textareas, add a function call that stores the id in a variable, and then use this in a getElementById in your insert function.
[/quote]

Nice. Why didn't I think of that... Easy and good solution!

Thx man.
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.