Solved

How to output to two frames

Posted on 1998-06-19
8
184 Views
Last Modified: 2013-12-25
I have set up two frames, one for a form and the other for the results/status. When I submit the form I want to output some information to one of the frames, and I want to output other information to the other frame. What is the HTML source code for this.

I'm writing my cgi code using C, but I think this should be language independent because I suspect the trick is in the HTML source code.

Thanks.
0
Comment
Question by:santama
  • 4
  • 3
8 Comments
 
LVL 1

Accepted Solution

by:
RoboBob earned 100 total points
Comment Utility
The trick is not to try to load each frame separately, but to redirect to the parent frame that contains the two frames, so you are loading the page that has the <FRAMESET> tags, which then loads the two frames that it contains...  (If this isn't very clear let me know and I can come up with some sample code...)
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
There are JavaScript ways and non-javascript ways
the first can be from one cgi, the second from the cgi + a file produced by the cgi...

I will let RoboBob get his say...

Michel
0
 

Author Comment

by:santama
Comment Utility
RoboBob:

I really don't know much about html as I do about C/C++. So I think I'll take your offer on the sample source code.

Santama
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
RoboBob: I suspect your solution will include the writing and storing of files as in

a: calculate and store result.htm and info.htm
b: output frameset with
<FRAMESET ROWS="50%,*">
<FRAME SRC="result.htm">
<FRAME SRC="info.htm">
</FRAMESET>

This is not necessary if JavaScript is used...

Michel
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:santama
Comment Utility
I'm really trying to avoid temp files.


0
 

Author Comment

by:santama
Comment Utility
How about the JavaScript solution.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
1. Use frames
<FRAMESET ROWS="50%,50%,*">
<FRAME NAME="result" SRC="/cgi-bin/calc.exe">
<FRAME NAME="cgistatus" SRC="empty.html">
</FRAMESET>

2. in your cgi, produce something like the following output:

print("<HTML>")
print("<HEAD>
print("<SCRIPT LANGUAGE='JavaScript'>")
print("top.frames[1].document.open();")
print("top.frames[1].document.write(%s);",status)
print("top.frames[1].document.close();")
print("</SCRIPT>")
print("</HEAD>")
print("<BODY>")
print("here comes your result:")

and so on

An alternative is using the http-header
Window-target: cgistatus

from a second cgi or a second call to the same cgi

Enjoy,

Michel

PS: If you accepted the answer by mistake, go to customer service and tell them
0
 

Author Comment

by:santama
Comment Utility
Thanks Michel,

David.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to count occurrences of each item in an array.

762 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

9 Experts available now in Live!

Get 1:1 Help Now