?
Solved

Need help with HTML Redirect ...

Posted on 2009-04-09
8
Medium Priority
?
245 Views
Last Modified: 2012-08-13
Hi,

I have an HTML page that uses an iFrame to embed a webform.  When the user completes the webform they click a button that saves their information to my database.

I also want to do a Response.Redirect that redirects the parent form, not the webform in the iFrame.  How do you redirect the parent form?  I tried the following, but that just redirects the form in the iFrame:

Response.Redirect("http://www.ExecutiveDecision.biz")

Thanks!
0
Comment
Question by:MitchellVII
8 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 2000 total points
ID: 24107015
> I also want to do a Response.Redirect that redirects the parent form, not the webform in the iFrame.  How do you redirect the parent form?  

Not by ASP, because ASP knows nothing about frames. So you have to use (client-side) javascript. Send a file to the iframe with
<script>
top.location.href='newpage.asp';
</script>
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24107031
or this
<script>
location.replace('page.asp');
</script
0
 
LVL 5

Author Comment

by:MitchellVII
ID: 24107118
sybe,

Hmm, ok.  Well, right now, I just have a button on the bottom of my form that is calling an ASP Script, like so:

<form method="post" action="scripts/asp/DocEPW_INSERT_IT_Result.asp" enctype="multipart/form-data">

How would I get it also to call some JavaScript?  Just create a JavaScript Function and add it to the action= statement like so:

<form method="post" action="scripts/asp/DocEPW_INSERT_IT_Result.asp;myJavaRedirect()" enctype="multipart/form-data">
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 54

Expert Comment

by:Ryan Chong
ID: 24107168
try like:

<form method="post" action="scripts/asp/DocEPW_INSERT_IT_Result.asp" enctype="multipart/form-data" onsubmit="myJavaRedirect();return false;">
0
 
LVL 28

Expert Comment

by:sybe
ID: 24107226
The form needs at attribute target="_top, then it is posted to the window. I know that the attribute "target"for <form> has become invalid in XHTML, but ther is no good alternative, and browsers support it.
0
 
LVL 28

Expert Comment

by:sybe
ID: 24107236
So if you use

<form target="_top".......>

you don't need no javascript.
0
 
LVL 5

Author Comment

by:MitchellVII
ID: 24232960
sybe,

Ok, I am a bit confused as to how to implement:

<form target="_top".......>

Let's say I want to redirect the parent form page to 'http://www.ExecutiveDecision.biz', how would I do that?
0
 
LVL 5

Author Closing Comment

by:MitchellVII
ID: 31568516
This worked.  Thanks!
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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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

840 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