Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do i change the url of the parent form from an iFrame form?

Posted on 2012-03-10
5
Medium Priority
?
543 Views
Last Modified: 2012-03-11
I have an iFrame subform on my parent form.  When I submit the form on the Iframe subform, I would like to have a Redirect statement that changes the url of the parent form.

How would I do that?
0
Comment
Question by:MitchellVII
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Kim Walker
ID: 37706058
Do you want to change the url in the parent form "action" attribute or do you want to load a different page in the parent window altogether?

Using javascript, you can access the iFrame parent using the parent object:
parent.document.forms[0].action = 'newurl';
parent.window.location = 'newlocation';

Open in new window

0
 
LVL 5

Author Comment

by:MitchellVII
ID: 37706412
I am just looking for the

Response.Redirect()

statement to use in my ASP script.
0
 
LVL 22

Accepted Solution

by:
Kim Walker earned 2000 total points
ID: 37706871
Response.Redirect() is a server-side function that tells the server how to respond to a request from a client computer. Once the parent page and iFrame have been loaded, Response.Redirect() is powerless to change the content of either without some client-side activity which generates a new request and then it can only direct that response to the source of the request. The server is powerless to control the content of the parent window through the iFrame window. Only client-side scripting can bridge that gap.
0
 
LVL 5

Author Comment

by:MitchellVII
ID: 37707199
Ah ok.

I guess I'll just have to write a "Thanks!" page to pop up in the iFrame instead of redirecting the parent.
0
 
LVL 5

Author Closing Comment

by:MitchellVII
ID: 37707201
Wish the answer was different but it is the correct one :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question