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

Posts: 9
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
 
When You Register, These Ads Go Away!
Old 08-19-2005, 09:37 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
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 Visit Anacrusis's homepage!
 
Old 08-22-2005, 05:33 PM
Novice Talker

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

Thread Tools

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

vB 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.11649 seconds with 12 queries