Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2005, 09:48 AM
Friend of Wrox
 
Join Date: May 2004
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.
 
Old April 21st, 2005, 11:53 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old April 21st, 2005, 01:24 PM
Friend of Wrox
 
Join Date: May 2004
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

 
Old April 21st, 2005, 01:33 PM
Friend of Wrox
 
Join Date: May 2004
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.

 
Old April 21st, 2005, 03:49 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.