Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

post leaves out form variables with empty values: msg#00017

Subject: post leaves out form variables with empty values

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
m_klein@xxxxxxx
<Prev in Thread] Current Thread [Next in Thread>