SyntaxFix
Write A Post
Hire A Developer
Questions
If you do not care about repetitive form elements with the same name, then you can do:
var data = $("form.login").serializeArray(); var formData = _.object(_.pluck(data, 'name'), _.pluck(data, 'value'));
I am using Underscore.js here.