Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
find element that lost focus?
Old 08-19-2005, 04:21 PM find element that lost focus?
Novice Talker

Posts: 9
Trades: 0
Hi all,

How can I get the ID of an element that just lost the focus?

for exmaple:

There are serveral "text" elements in a form in the main page (parent), one of them has the focus before i click a link on the page to open a new window (child). how can know which text element that just lost the focus and get this ID in the child window?

Thanks
moon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-19-2005, 09:37 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
At the top of your page do this
Code:
<script type = "text/javascript">
    var last;
</script>
then, on each of your text boxes add this
Code:
onFocus="last=this"
Then, in your link, you can reference the last variable which will contain the last element that had focus.
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 08-22-2005, 05:33 PM
Novice Talker

Posts: 9
Trades: 0
Great! it works. Thank you!
moon is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to find element that lost focus?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10877 seconds with 12 queries