Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

form data to json

function formDataToJson(formData){
    let json = {};
    if(!(formData instanceof FormData)) return json;
    formData.forEach((value,key)=>{
        json[key] = value;
    });
    return json;
}
 
PREVIOUS NEXT
Tagged: #form #data #json
ADD COMMENT
Topic
Name
1+4 =