Link to home
Start Free TrialLog in
Avatar of santama
santama

asked on

How to output to two frames

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.
ASKER CERTIFIED SOLUTION
Avatar of RoboBob
RoboBob

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michel Plungjan
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
Avatar of santama
santama

ASKER

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
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
Avatar of santama

ASKER

I'm really trying to avoid temp files.


Avatar of santama

ASKER

How about the JavaScript solution.
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
Avatar of santama

ASKER

Thanks Michel,

David.