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.
[!--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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.