Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get form data in js

// return data in key value pair
$('#form').serializeArray().reduce(function(obj, item) {
    obj[item.name] = item.value;
    return obj;
}, {});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #form #data #js
ADD COMMENT
Topic
Name
9+8 =