Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 21st, 2005, 09:48 AM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object Properties & document.activeElement

Hi all,

I can't seem to get this to work:

document.getElementById(document.activeElement.id)

I just get "null is not an object" errors.

But this works:

alert(document.activeElement.id)

I get the ID of the active element! Whats going on here?

Cheers for now
interrupt


__________________
\'sync\' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
Reply With Quote
  #2 (permalink)  
Old April 21st, 2005, 11:53 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I can't see why you'd want to do that but are you sure that's the exact code, it seems to work for me?

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old April 21st, 2005, 01:24 PM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm trying to cheat my way round using onFocus(). That is the code I'm using, but I just get that null message. Maybe its something in my script. Suppose I'll have a go with it standalone.

cheers anyhow
interrupt

Reply With Quote
  #4 (permalink)  
Old April 21st, 2005, 01:33 PM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, now I'm just getting [object]. How do I expose the objects properties? I'm trying to pass the activeElement's ID into an array. I have everything else worked out, but the activeElement method doesn't seem to bubble.

Reply With Quote
  #5 (permalink)  
Old April 21st, 2005, 03:49 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Can you show a small sample of what you're trying to accomplish?

--

Joe (Microsoft MVP - XML)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Document.activeElement HemaRaj Ajax 0 February 19th, 2008 11:11 AM
Extracting Custom Document Properties for Word Doc jayanth_nadig XSLT 2 October 30th, 2007 03:31 AM
Firefox - XSLT - document.links has no properties tripecac XSLT 5 April 27th, 2007 12:35 PM
Extracting COM Object Properties walkins5 General .NET 0 February 5th, 2005 09:34 PM
Object properties in an ArrayList augustwest C# 4 June 16th, 2004 04:35 PM



All times are GMT -4. The time now is 11:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.