How can I remove a specific item from an array in JavaScript? New external SSD acting up, no eject option. Object.fromEntries: Supported in Chrome 73+, Firefox 63+, Safari 12.1. Or alternatively you can do the same with the modern day Fetch API: See also Using The Fetch API on MDN for reference. This object has field names as its keys and corresponding field values as its values. #dom However yours will still overwrite on repeated values. You get into heavy discussions of whether you should use for, forin, forof, or forEach, and after trying to keep up with the various performance, semantic, and stylistic reasons for making those choices, your brain starts to liquefy and drip out your ears at which point its easy to just say, Forget it; lets just use jQuery.. You can also make the for of statement more expressive if you're using ES6: @nackjicholson Yeap, you are right, omitting .entries() and the [k,v] element simplify the code. Next, we need to add an if check for whether or not our element is valid in formToJSON(). Here is code based on the accepted answer which accounts for this case: This works for me. The closest you can get probably is to write a simple script that runs server side, and saves everything you, just for training purposes, if i can do this, plz help me. A tiny yet effective jQuery Form To JSON converter that converts form fields and their values into a JSON object on submit. No spam ever. I posted a new answer based on this one to handle those cases. The whole task is implemented in a PHP function get_data(). You could also use forEach on the FormData object directly: And for those who prefer the same solution with ES6 arrow functions: And for those who want support for multi select lists or other form elements with multiple values (since there are so many comments below the answer regarding this issue I will add a possible solution): Here a Fiddle demonstrating the use of this method with a simple multi select list. gfg.php This gfg.php file demonstrates the PHP code to which the HTML form contents are posted. Is the amplitude of a wave affected by the Doppler effect? As it stands, formToJSON() is actually made of three parts: NOTE: The form elements are actually whats called an HTMLFormControlsCollection, which is array-like, meaning its basically an array, but its missing some of the array methods, and has some of its own special properties and methods. This article looks at what happens when a user submits a form where does the data go, and how do we handle it when it gets there? The