Solved

CGI script returning a HTML document to a given frame

Posted on 1997-05-25
1
187 Views
Last Modified: 2013-12-25
How to have a CGI script return a HTML document to a given frame ?

I defined a frameset with two frames frameA and frameB.
I defined a form formX in frameB.
Should the user submit formX, I want the CGI script to return a HTML document
which modifies frameA and not frameB.

It's easy with a simple hyperlink:

<A TARGET="frameA" HREF="http://www.something.com">

But this doesn't work with javascript:

<A TARGET="frameA" HREF="javascript:'window.top.frameB.document.formX.submit ()'">

How to proceed ?
0
Comment
Question by:stormtrooper
1 Comment
 
LVL 5

Accepted Solution

by:
Trevor013097 earned 100 total points
ID: 1828097
Are you using a CGI script or Javascript.  A CGI would be done server side using something like Perl and Javascript is client side.

From what you have posted you don't need the TARGET when using Javascript as the targeting is done by Javascript itself.  You should place what it is you want to do into a function and then call the function.

For Example

<SCRIPT LANGUAGE="Javascript">

function returnPage() {
  parent.frameB.location="page-name.html"
}

</SCRIPT>

Place the above in the <HEAD> secton of your page.

Then in your body use the following for a hypertext link:-

<A HREF="javascript:returnPage();">Return Page</A>

or to have the function called when your form is submitted use the following in the opening <FORM> tag:-


<FORM NAME="name_of_form" ACTION="your-action" onSubmit="returnPage()">

Hope this helps,

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

713 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