Fork me on GitHub
#reagent
<
2017-04-27
>
PotatoDepaulo21:04:31

Hey all! I’m stuck on something that I’m sure has a simple solution somewhere out there: I want to package all the field data of a form and send them via a post. I’ve already written everything except for the part where I capture the data.

rgdelato21:04:18

in JS, if I had an uncontrolled form, I would use something like form-serialize on the form submit:

import serializeForm from 'form-serialize';

<form onSubmit={(event) => handleSubmit(serializeForm(event.target, {hash: true}))}>
...but I'm also new to CLJ so I don't know what the CLJS equivalent would be

rgdelato21:04:10

I guess there's getFormDataMap on goog.dom.forms, but that returns a weird wrapper thing rather than an object: https://google.github.io/closure-library/api/goog.dom.forms.html

PotatoDepaulo21:04:52

Hmm. Thanks! I’ll look into that getFormDataMap