Home > Blockchain >  How can I make data visible on an alert box?
How can I make data visible on an alert box?

Time:11-09

It is fully functional. I want to check all the data. Using this, I can't see all the data.

alert("SHOW FORM DATA");   
alert(PreparedFormObj());

FORM DATA

var PreparedFormObj = function () {
    var _FormData = new FormData()
    _FormData.append('Id', $("#Id").val())
    _FormData.append('CreatedDate', $("#CreatedDate").val())
    _FormData.append('CreatedBy', $("#CreatedBy").val())
    _FormData.append('ProductId', $("#ProductId").val())
    _FormData.append('ProductModelNo', $("#ProductModelNo").val())
    _FormData.append('Name', $("#Name").val())

    return _FormData;
}

SAVE DATA

var SaveProduct = function () {   

    alert("SHOW FORM DATA");
    alert(PreparedFormObj());

}

CodePudding user response:

for example convert to json

alert(JSON.stringify(Object.fromEntries(PreparedFormObj())));
  • Related