Is there a simple, one-line way to get the data of a form as it would be if it was to be submitted in the classic HTML-only way?
For example:
use .serializeArray() to get the data in array format and then convert it into an object:
function getFormObj(formId) { var formObj = {}; var inputs = $('#'+formId).serializeArray(); $.each(inputs, function (i, input) { formObj[input.name] = input.value; }); return formObj; }