Solved

Need help with HTML Redirect ...

Posted on 2009-04-09
8
240 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 500 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
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 51

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

Industry Leaders: 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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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. …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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 …

749 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