Solved

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

Posted on 2012-03-10
5
533 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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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).

729 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