Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getElementById in other frames

Status
Not open for further replies.

balli

Programmer
Aug 1, 2005
3
IS
I have a page where you can click on buttons in one frame, and then I'd like some numbers to update in another frame of the page. I have tried to use
Code:
parent.[frame].getElementById([id]).innerHTML = '[updated_value]';
but without any luck. I thougt it would work, because it works within a page, and using parent.[frame].getElementById works to update some values (e.g. changing the size of frames).
I hope you can help me (because I'm going slightly mad figuring this out)
 
Are you actually putting the [] around 2 of your values, or is that just for posting purposes to illustrate something?

Personally, I would NOT be putting that around the frame name or the ID - it will only lead to JS errors.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Well, no, I'm not putting the brackets in the code. I used them to show where I put the name of the frame and the id and the new value in the code.
 
WOOHOO, I just figured it out myself:
Code:
parent.frame['frame_name'].document.getElementById('id').innerHTML = 'updated_value';
 
Code:
parent.frame[red][b]s[/b][/red]['frame_name'].document.getElementById('id').innerHTML = 'updated_value';

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top