Convert form data to JavaScript object with jQuery

Опубликовано: 15 Октябрь 2024
на канале: Code Samples
466
5

How do I convert all elements of my form to a JavaScript object?
I'd like to have some way of automatically building a JavaScript object from my form, without having to loop over each element. I do not want a string, as returned by $('#formid').serialize();, nor do I want the map returned by $('#javascript serializeArray: http://api.jquery.com/serializeArray/