I am using Compojure (version 1.1.6) for a webapp having an html form
in which some text input fields are non-mandatory. But when it is
submitted with one or more of these fields left blank, it results in a
malformed `form-params` map in the request handler.
for eg. suppose `qty`, and `qty_unit` are non-required form fields.
For debugging, I am just printing form-params in the handler
(defn add-entry
[{form-params :form-params}]
(println form-params))
If both the fields are left empty, following is printed:
{timezone -330, date 2014-03-07, qty_unit , qty , title dfsdfdfsdfsdfsd}
If just one of the fields is left empty, form-params turns out to be a
map with odd number of forms (but still no error):
{timezone -330, date 2014-03-07, qty_unit , qty 1, title dfsdfdfsdfsdfsd}
The form is submitted via ajax using jquery's `serializeArray` [1] and the
submitted form data displayed in chrome console looks correct. Also,
there are no other ring middlewares applied to this particular route.
What am I missing?
Regards,
Vineet