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

Frame Redirect IE vs FF?

Status
Not open for further replies.

ThatRickGuy

Programmer
Oct 12, 2001
3,841
US
Hi Guys and Gals,
I have a page with some iFrames. In one of those frames is a page with a submit button. When the user clicks that button I need another frame on the parent to redirect. I had been using this:

Code:
<input type="submit" id="btnSubmit" value="Upload" onclick="self.parent.frames['Display'].location='Display.aspx?Enabled=True';"/>

and it works fine in IE7, but when I checked the page out in FF, when I clicked the button, the other frame failed to change.

Thoughts?

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
I think I found a working solution:

Code:
<script>
  function UpdateDisplayFrame(){
    parent.document.getElementById('Display').src = "Display.aspx?Enabled=True";
  }
</script>

Code:
<input type="submit" id="btnSubmit" value="Upload" onclick="UpdateDisplayFrame();"/>

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Frames is pretty much my weakest point in javascript since I never use them. However, since you're redirecting the frame from the onclick of the submit button, could you just change the <form> tag that the submit button resides in to use the target parameter to submit to that frame instead. Something like this:
Code:
<form id="theForm" action="Display.aspx?Enabled=True" [!]target="Display"[/!]>
   <input type="submit" id="btnSubmit" value="Upload" />
</form>

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top