jQuery.formSerialize.js

$.fn.serializeObject = function() { var o = {}, a = this.serializeArray(); $.each(a, function() { if (o[this.name]) { 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; };
form data ~> javascript object

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.