Here is the HTML code:
HTML Form Builder
Try this for getting form input text value to JavaScript object...
var fieldPair = {}; $("#form :input").each(function() { if($(this).attr("name").length > 0) { fieldPair[$(this).attr("name")] = $(this).val(); } }); console.log(fieldPair);