473,508 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

any way to detect which textarea I am in?

Hello,

Is there a way to detect which textarea the cursor is positioned in? I
would not want to attach 'onkeypress' to all textareas to detect which
one I am presently in ... or is this the only option?

Thank you very much,

denis
Jul 23 '05 #1
2 1193
"Denis Perelyubskiy" <ne********@dslextreme.com> wrote in message
news:10*************@corp.supernews.com...
Hello,

Is there a way to detect which textarea the cursor is positioned in? I
would not want to attach 'onkeypress' to all textareas to detect which
one I am presently in ... or is this the only option?

Thank you very much,

denis


How will you handle mouse clicks?

Why do you need do to this?
Jul 23 '05 #2
McKirahan wrote:
"Denis Perelyubskiy" <ne********@dslextreme.com> wrote in message
news:10*************@corp.supernews.com...
Hello,

Is there a way to detect which textarea the cursor is positioned in? I
would not want to attach 'onkeypress' to all textareas to detect which
one I am presently in ... or is this the only option?
How will you handle mouse clicks?


I did not think of that, but I was just throwing out an option :)
Why do you need do to this?


I am trying to make an extension for Firefox, which will process
keypresses for textareas. This will require that 'onkeypress' be
attached dynamically. The functionality is event-driven (some key
combination shall trigger it). I could either iterate through all
forms/textareas (I hope :)) and attach my handlers to all of them, or
try to be more intelligent and attach the event handler only to the form
in which I detect the cursor at a point when my key combination is fired.

I admit this may not be the cleanest way of doing things, but this is my
first attempt at this - btw, if you have any suggestions, I'd absolutely
love to hear them.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7796
by: francescomoi | last post by:
Hi. I've got a textarea form and send a text via 'POST' to a PHP code: ------------- data1 data2 data3 -------------- I use this piece of code:
5
4780
by: STB | last post by:
Hi, Can you pick out just the text that a user has selected in a TextArea using JS?
2
10720
by: delraydog | last post by:
Is there anyway to detect if scrollbars were made visible in a textarea? I'm not talking about initial setting of the scrolling attribute, but rather whether scrollbars have been added either...
8
6562
by: bissatch | last post by:
Hi, I have a text box where the user enters their employee email address. What I want to occur is when the @ sign is pressed it will automatically add the rest (ie. mycompany.com) I know the...
2
3649
by: Charles | last post by:
Is there a way to detect if a window is out of focus? Here's what I need it for: I have a web-based chat application that one of the 2 people chatting may have the chat window open or minimized....
6
2414
by: SLH | last post by:
if i have a text area on a page that i want to validate, and i dont want there to ever be 2 "enter"s in a row, how can i check for this? ive been playing with something like: If InStr(string,...
13
31909
by: halbenca | last post by:
Is this possible with Javascript in anyway? :)
3
19258
by: Ciaran | last post by:
Hi can someone give me the code to convert a line break in a multiline textfield to a <br/tag ? It's something to do with CR LF but I can't find the exact code anywhere. Cheers, Ciarán
1
2065
by: mapradheep | last post by:
hi all i have 25 components which includes and i have written a key event where i say that function, when "ENTER" is entered, i call a function which will submit the page. now my page is getting...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.