Mail Archives: djgpp/1998/06/04/12:47:15
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 -