
Sending form data made easy with – diver.js - cafebabe1991
https://github.com/raul1991/diver.js
======
BrandoElFollito
I may be missing something (I am an amateur dev) but isn't this made easy with
Vue?

I use it when I need to process a form and just send the relevant "data" part
(or all of "data") upon "sumbit" being fired off.

~~~
cafebabe1991
This works for non-form elements as well which was a necessity in my case.

~~~
BrandoElFollito
When looking at your example, I see <input> (various types). If you bind these
in Vue, you can send them upon some kind of event (a submit button, a click on
a div, the value of some variable,...).

------
ricardobeat
Why do we keep rewriting libraries like this? We were writing the exact same
thing at one of my previous jobs back in 2010.

~~~
manigandham
the point of the library is so it doesnt get rewritten - did you open source
what you did before?

~~~
ricardobeat
Yes, that's the point I'm making. You can currently find dozens upon dozens of
the same in NPM:
[https://www.npmjs.com/search?q=form+serialize](https://www.npmjs.com/search?q=form+serialize)

~~~
cafebabe1991
Thanks for sharing this link, I have however used this library. Things that I
did not like in this because of the following reasons

1\. I cannot put the values of one object inside the other unless they come
under the same parent.

2\. Arrays in my case can be created in one go and you need not specify the
array indexes hard coded in the html itself.

3\. In my case some inputs were not inside any forms. This library mandates
that it should be so it did not work for me.

I understand my code will be far less sophisticated but I made it to solve a
problem and learn javascript as well. I did and wanted to see how many others
face the same problem and can use it.

