Solved

Need help with HTML Redirect ...

Posted on 2009-04-09
8
241 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
[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
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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 52

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

738 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