On Wed, 19 Sep 2001 [EMAIL PROTECTED] wrote:

> I have a page with a list of several "Objects" on it.  I want the user
> to be able to click a button next to each object and have that button
> submit a form to a CGI script, but I don't want anything to change on
> the page - I do not to have to regenerate the list of objects, I just
> want to flip a check box to the checked state next to the object they
> selected.  The checkbox is easily handled through javascript, but how
> do I avoid replacing the contents of the current frame with the output
> from the CGI script?

Normally, your script or (more often) returns a http status code of 200
with each successful response, indicating that the request was valid and a
response follows. What you want is http status code 204, "no content".
This means that, quote:

    The server has fulfilled the request but does not need to return an
    entity-body, and might want to return updated metainformation. The
    response MAY include new or updated metainformation in the form of
    entity-headers, which if present SHOULD be associated with the
    requested variant.

    If the client is a user agent, it SHOULD NOT change its document view
    from that which caused the request to be sent. This response is
    primarily intended to allow input for actions to take place without
    causing a change to the user agent's active document view, although
    any new or updated metainformation SHOULD be applied to the document
    currently in the user agent's active view.

    The 204 response MUST NOT include a message-body, and thus is always
    terminated by the first empty line after the header fields.

See <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5>

I've never tried to do this, so am not sure the best way to go about it,
but basically what you want to do is coerce the server into returning that
204 status code (assuming that that's even on the right track, but it
sounds like it is). I think that if you're using CGI.pm, you can set your
script to return NPH data, meaning that the server should not attempt to
parse the header data. The important thing is that you want to send only
http headers: the response code, cookies, etc, but no html (etc) content. 
 
Let me know if this has or hasn't pointed you in the right direction...
 


-- 
Chris Devers                     [EMAIL PROTECTED]

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to