Wondering is there a function in javascript without jquery or any framework that allows me to serialize the form and access the serialized version?
Here is pure JavaScript approach:
var form = document.querySelector('form');
var data = new FormData(form);
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
xhttp.open("POST", "", true);
xhttp.send(data);
}