jkk / formative

Web forms for Clojure and ClojureScript - rendering, parsing, and validating
208 stars 18 forks source link

Can't upload file #68

Closed punit-allstreet closed 4 years ago

punit-allstreet commented 4 years ago

I am rendering a form by using the handle-submit fn as I don't want the submit button to fire a post request on clicking.

But I have a file upload field in my form. And when the formative.dom/handle-submit fn calls the formative.dom/serialize fn, it removes the file input field type while it's serialising form parameters and hence the formative.parse/parse-input fn is never called.

So how can I do file upload without having the default POST behaviour?

iku000888 commented 4 years ago

Hi @punit-allstreet !

I think I can't help much directly as I have not used the formative.dom facility myself. IMO it is a method that was a workaround for the lack of react back in the days, so if it is for a new page I strongly would recommend a react based solution such as reagent-forms.

Other than that happy to look at a minimal project or accept PRs!