Solved

Need help with HTML Redirect ...

Posted on 2009-04-09
8
230 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
 
LVL 49

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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/…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now