JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 2009, 12:22 PM
ineloquucius ineloquucius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 102 ineloquucius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 45 m 29 sec
Reputation Power: 6
How to access object & values within iframe'd document

For example if I do:

Code:
<iframe id="myframe" src="http://mysite.com"></iframe>


and I want to set the value of the search field there, how do I access that field? I've already ignorantly tried:

Code:
document.getElementById('myframe').document.getElementByID('mytextArea').value

Reply With Quote
  #2  
Old October 2nd, 2009, 02:08 PM
ineloquucius ineloquucius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 102 ineloquucius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 45 m 29 sec
Reputation Power: 6
Anyone?

Reply With Quote
  #3  
Old October 2nd, 2009, 02:52 PM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 2,056 Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced Folder
Time spent in forums: 2 Weeks 3 Days 7 h 58 m 28 sec
Reputation Power: 1319
i would actually have to dig into this is see if I'm right (its been a long time for me and frames) but i believe you should just be able to refernce like:

document.frame.form.object.value

or document.frame.getelementById("object").value;
__________________
Three gigs for the secretaries fair
Seven gigs for the system source
Nine gigs for the coders in smoky lairs
One disk to rule them all, one disk to bind them
One disk to hold the files, and in the darkness grind'em
---------------------------------------------------
It is by caffeine alone that I set my mind in motion.
It is by the beans of Java, that my thoughts acquire speed.
The hand acquire shakes; the shakes become a warning.
It is by caffeine alone that I set my mind in motion.

Reply With Quote
  #4  
Old October 3rd, 2009, 08:09 AM
ineloquucius ineloquucius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 102 ineloquucius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 45 m 29 sec
Reputation Power: 6
Strictly speaking, it's an iframe, not a frame that I'm working with...don't know if that makes a difference. But either way, I'm still unclear about how to refer to elements and values within that iframe.

I mean, I might have three iframes, how does the browser know which one?

Reply With Quote
  #5  
Old October 4th, 2009, 08:10 AM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 2,056 Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced Folder
Time spent in forums: 2 Weeks 3 Days 7 h 58 m 28 sec
Reputation Power: 1319
once again, its been awhile, but as i remember frames and iframes are treated the same.

Reply With Quote
  #6  
Old October 5th, 2009, 07:48 AM
ineloquucius ineloquucius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 102 ineloquucius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 45 m 29 sec
Reputation Power: 6
Wasn't picking on your frames knowledge, just figured I'd be specific in case it was relevant.

I still can't do this, in any case. Isn't there some way or some tool out there that can read my document and say "sure, that DIV there is referred to as document.html.body.div[3]"? DOM Inspector does not do this within iframes.

I've tried window.frames[0-2].whatever (="URL" or "bgColor" or anything that DOM inspector claimed has in fact some value assigned). I've been trying to "alert" these values on a mouseover and nothing happens. If I change the alert target to anything at the parent window level, no problem...including of course the iframe tag itself (not the contents of that frame) and attributes assigned to it.

Last edited by ineloquucius : October 5th, 2009 at 08:05 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > How to access object & values within iframe'd document

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap