Answers for "jquery serialize form to object"

0

jquery serialize form data to object

var data = {};
$(".form-selector").serializeArray().map(function(x){data[x.name] = x.value;});
Posted by: Guest on September-01-2021
1

jquery form serialize object

$(function(){
  $('form').on('submit', function(e){
    e.preventDefault();
    $(this).serializeObject().done(function(o){
      if(window.console) console.log(o);
      var j = JSON.stringify(o);
      alert(j);
      //window.open("data:image/png;base64," + o.userfile.data);
    });
  });
});
Posted by: Guest on May-01-2020

Code answers related to "jquery serialize form to object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language