Solved

Need help with HTML Redirect ...

Posted on 2009-04-09
8
228 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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)

708 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

20 Experts available now in Live!

Get 1:1 Help Now