You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/share/static/js/jquery.serializeObject.js

20 lines
505 B

/*
http://stackoverflow.com/questions/1184624/convert-form-data-to-js-object-with-jquery
*/
(function ($) {
$.fn.serializeObject = function()
{
var o = {};
$.each(this.serializeArray(), function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
};})(jQuery);