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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames + window.parent

Status
Not open for further replies.

dranium

Technical User
Mar 9, 2009
15
0
0
CA
Hello,

I have a site that contains 2 frames, the main frame which contains the question and my bottom frame which contains numbering from 1 to 10. This code works great in IE browsers but when I try to use this in FireFox nothing happens when I click on the numbering. Is there a different way I can write this simple line in FireFox?

Code:
<a href="javascript:window.parent.navbody.pag_vars(1,9);window.parent.navbody.questionform.submit();" >9</a>
 
Assuming 'navbody' is the name of a frame, and 'questionform' is the name of a form within that frame, try this:

Code:
javascript:window.parent.frames['navbody'].pag_vars(1,9); window.parent.frames['navbody'].forms['questionform'].submit();

Hope this helps,
Dan




Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Thanks for the reply Dan, your code didn't work but it helped me figure out why it wasn't working. I needed to add document.forms in my code and now everything works with FireFox.
 
[&nbsp;]
Where did you add document.forms in your code?

mmerlinn


"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Steven Raymond
 
I switch this...
<a href="javascript:window.parent.navbody.pag_vars(1,9);window.parent.navbody.questionform.submit();" >9</a>

To this...
<a href="javascript:window.parent.navbody.pag_vars(1,9);window.parent.navbody.document.forms.questionform.submit();" >9</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top