[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CGI script returning a HTML document to a given frame

Posted on 1997-05-25
1
Medium Priority
?
203 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 200 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to dynamically set the form action using jQuery.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 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