Connecting Tech Pros Worldwide Help | Site Map

Detect the cursor location using javascript

Newbie
 
Join Date: Oct 2009
Location: India
Posts: 1
#1: 3 Weeks Ago
hi all

i have 25 components which includes [textarea, textfile, radio, combo, etc...] 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 submitted when i press enter even in the textarea which should not be. so is there any that i can leave not to submit the page if its textarea. this happens only in IE7, 8. all the other browser its working.

can you help or suggest me on this
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,126
#2: 3 Weeks Ago

re: Detect the cursor location using javascript


for IE you could check the event's target (in IE it is srcElement) id like:

Expand|Select|Wrap|Line Numbers
  1. event.srcElement.id
kind regards
Reply


Similar JavaScript / Ajax / DHTML bytes