[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Redirect afer form submit within iframe

Posted on 2006-10-30
6
Medium Priority
?
523 Views
Last Modified: 2012-06-21
I have a form within an IFRAME.  I have no control of the IFRAMED form.  I need to redirect the user to another page once the user submits the IFRAMED form. In other words, once the "thank you message" is shown in the IFRAMED page, I need to take the user to a different location.  My page containing the IFRAME is a Coldfusion page just in case that helps.  Is there any way to accomplish this redirect?
0
Comment
Question by:sweetbuttercup
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:mvan01
ID: 17836599
Hi SweetButterCup,

I think if the form within your IFRAME is from your domain, you can determine when the "thank you message" is displayed, and redirect.  If it comes from a different domain, I believe you will not be able to query its content.

To redirect your site within javascript, set:
document.location.href = 'yourNextFile.htm';

Peace and joy.  mvan
0
 
LVL 12

Expert Comment

by:jessegivy
ID: 17836644
<form onsubmit="this.parent.document.location='directory/newpage.cfm'">

...you could add the above to simply redirect the page after you've posted to the server.  Have you already satisfied the typical form requirements i.e. uploaded info to server and stored in the database?  If you want them to see the "thank you" message however, you'll need to set a javascript timeout, which would look somethin like this:
function loadPage()
{
     setTimeout("this.parent.document.location='directory/newpage.cfm'",1000)
}
<form onsubmit="loadPage();">

...obviously the form tag would include more than just an onsubmit event but I hope you get the idea?  the 1000 is the number of milliseconds to wait before redirecting the page.  1000 milliseconds==1 second.

Let me know if I'm way off track,

Jesse
0
 
LVL 1

Author Comment

by:sweetbuttercup
ID: 17836703
if the form is in my domain I wouldn't  have any problem to redirect after submit.  I don't have control of the form page.  Is in a different domain and i cannot make changes to it.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Accepted Solution

by:
mvan01 earned 2000 total points
ID: 17837151
Hi SweetButterCup,

Sorry, the correct answer is, you can not read pages from another domain.
This is somethoing that the browser is not allowed to do, for security reasons.

http:Q_20531959.html
http:Q_21804964.html#16396910

Presuming you knew the url of the "thank you message," you can't even read the url, if it is from another domain:
http:Q_10058491.html

Peace and joy.  mvan
0
 
LVL 1

Author Comment

by:sweetbuttercup
ID: 17844868
Thank you anyways
0
 
LVL 11

Expert Comment

by:mvan01
ID: 17844907
You are welcome.  Peace and joy.  mvan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

830 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