Solved

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

Posted on 2012-03-10
5
528 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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 is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

838 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