Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to serialize form data in js

const serialize = (formElement) => {
    let data = new FormData(formElement);

    let obj = {};
    for (let [key, value] of data) {
        obj[key] = value;
    }
    return obj;
}
Source by gomakethings.com #
 
PREVIOUS NEXT
Tagged: #serialize #form #data #js
ADD COMMENT
Topic
Name
1+5 =