post leaves out form variables with empty values
Mark Klein <[email protected]> Thu, 24 Jun 2004 23:47:24 -0400
| Newsgroups | gmane.lisp.cl-http |
|---|---|
| Message-ID | <p05230100bd014b39d2ae@[192.168.1.100]> |
I traced a problem in my server to the following fact: As the example
below will show, if you create a fillout-form which gets some
strings, and the user leaves some fields blank when filling it out,
the query-alist passed to the response function *leaves out* the
variables for which no values were entered, as opposed for example to
including the variables with null strings as their value.
(defmethod show-form ((url url:http-form) stream)
(http:with-successful-response (stream :html)
(html:with-fillout-form (:post url :stream stream)
(html:accept-input 'html:string "v1" :stream stream)
(html:accept-input 'html:string "v2" :stream stream)
(html:accept-input 'html:submit-button "Submit" :stream stream))))
(defmethod get-form ((url url:http-form) stream query-alist)
(http:with-successful-response (stream :html)
(write query-alist :stream stream)))
(http:export-url #u"/test.html"
:html-computed-form
:form-function #'show-form
:response-function #'get-form)
I understand that makes the POST a little smaller, but for my
purposes I want all the form variables to appear in the query-alist.
How can this be done?
Thanks,
Mark
--
Mark Klein
Principal Research Scientist
Massachusetts Institute of Technology
77 Massachusetts Avenue, NE20-336
Cambridge MA 02139 USA
[email protected]