HOT TAKE - code reuse is good and all that, but I think there's a pressure to produce "open source" code that causes people to publish things that might be useful to them but are not entirely relevant.
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.
It is on github for over an year now. I was working on my own startup that time and hence could not get much time to publish it here. Now I had time so publishing here to get feedback on it.
I didn't really look too closely at this library, but I do have a need for some heavy form processing (not so much validation) on a new project I am working on. Got any recommendations?
I agree with you, but I was learning javascript and wanted to write something with it that could solve my form related problem. I tried using some libraries but some had bad notations and some did not work as expected. I wrote it on my own and thought to share it with people who have gone far beyond in js
and get their feedback. That is why I shared it.
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,...).
13 comments
[ 4.5 ms ] story [ 50.7 ms ] thread1. 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.
Here is a list of even more sophisticated libraries that might help you as well
https://www.npmjs.com/search?q=form+serialize
Someone already posted this link earlier here.
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.