delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/04/12:47:15

Message-ID: <3576CE51.A5B9BDB3@post.comstar.ru>
Date: Thu, 04 Jun 1998 20:41:53 +0400
From: Dim Zegebart <zager AT post DOT comstar DOT ru>
Reply-To: zager AT post DOT comstar DOT ru
Organization: Comstar Ltd.
MIME-Version: 1.0
To: "djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
Subject: HTML question (a bit off-topic ;)

Hi,
excuse me for slightly off-topic question, but it has some relation to
'C' too.
So,
I have created a html document with two frames in it which split screen
horizontaly.
Top frame contains form with various fields wich I send to my postgresql
backend via
cgi script written in C. Everething is fine and work properly exept one
thing -
cgi script return html page which I want to see in lower frame, but
instead of it
it displayed in top frame overwriting my form :(
My question is : How can I redirect output from cgi script which was
called via
_SUBMIT_ button as an _ACTION_ to the frame different from original
form-contained one.

Thanks in advance.

PS.
I know two and one not elegant sulutions :
1. I don't use _SUBMIT_ button. Just button with javascript function
attached.
In this function I parse all form's data, pass it char by char frought
javascript.escape() function
end send resulting string as param to cgi script like this :
var cmd='http://foo/cgi-bin/boo?'+form_data_constructed_string
parent.frames['my_frame'].location=cmd;
This is work !
2. At cgi script I just reproduce my original document with frames and
form plus query result and pass it back
to browser.
This is work too but not elegant at all !
3.At <form> tag I add 'target' attribute (not documented) like this
<form name='myform' method=GET action='http://foo/cgi-bin/boo' target=>
...
</form>
In this case Netscape will open a new window and displayed result in it.

/
--
____ ____
|   \   /   Dim Zegebart
____/____

Moscow Russia
WWW - http://www.geocities.com/siliconvalley/pines/7817
DZcomm - comm library for Allegro
Palantir - multitasking kernel for Allegro (based on PDMLWP)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019