Javascript 当ajax运行完成时,它会自动清除hiddenfield中保存的值以避免它
单击save按钮时,我正在处理程序中的每个函数中运行动态表,以在保存动态行上载文件后保存该文件,我在json中保存该值 在hiddenfield中保存值后,清除隐藏的字段值。它不存储在隐藏字段中 我需要hiddenfield json值保存在数据库中Javascript 当ajax运行完成时,它会自动清除hiddenfield中保存的值以避免它,javascript,jquery,ajax,Javascript,Jquery,Ajax,单击save按钮时,我正在处理程序中的每个函数中运行动态表,以在保存动态行上载文件后保存该文件,我在json中保存该值 在hiddenfield中保存值后,清除隐藏的字段值。它不存储在隐藏字段中 我需要hiddenfield json值保存在数据库中 $('#tblPower tbody tr').each(function () { debugger; var stre = $(this).c
$('#tblPower tbody tr').each(function () {
debugger;
var stre = $(this).children('td:nth-child(4)').find('input[type="file"]').attr("id");
var country = $(this).children('td:nth-child(1)').find('.Country').val() || 0;
var validity = $(this).children('td:nth-child(2)').find('.validity').val() || 0;
var clavalidity = $(this).children('td:nth-child(3)').find('.clavalidity').val();
var POAID = $(this).children('td:nth-child(2)').find('span').text() || 0;
var FileName = "";
var uploadfiles = $("#" + stre + "").get(0);
var uploadedfiles = uploadfiles.files;
var fromdata = new FormData();
for (var i = 0; i < uploadedfiles.length; i++) {
fromdata.append(uploadedfiles[i].name, uploadedfiles[i]);
}
var choice = {};
choice.url = "UploadHandler.ashx";
choice.type = "POST";
choice.data = fromdata;
choice.contentType = false;
choice.processData = false;
choice.success = function (result) {
FileName = result;
if (power == '') {
power = '{"POAID":"' + POAID + '","Country":"' + country + '","Validity":"' + validity + '","Notes":"' + clavalidity + '","UploadId":"' + stre + '","FileName":"' + FileName + '"}';
}
else {
power += ',{"POAID":"' + POAID + '","Country":"' + country + '","Validity":"' + validity + '","Notes":"' + clavalidity + '","UploadId":"' + stre + '","FileName":"' + FileName + '"}';
}
power = '[' + power + ']';
dynamic(power);
**$('#hfAttorney').val(power);**
};
choice.error = function (err) {
alert(err.statusText);
};
$.ajax(choice);
});
$('tblPower tbody tr')。每个(函数(){
调试器;
var stre=$(this).children('td:nth child(4)').find('input[type=“file”]”).attr(“id”);
var country=$(this).children('td:nth child(1)).find('.country').val()| | 0;
var validity=$(this).children('td:nth child(2)').find('.validity').val()| | 0;
var clavality=$(this.children('td:nth child(3)).find('.clavality').val();
var POAID=$(this).children('td:nth child(2)').find('span').text();
var FileName=“”;
var uploadfiles=$(“#”+stre+”).get(0);
var uploadedfiles=uploadfiles.files;
var fromdata=new FormData();
对于(var i=0;i
1-什么是动态(电源)代码>做。。。2-使您认为HFA
是“清除”的动态权限是功能保留。。如果我在hiddenfield中保存了值,但很明显,我无法在server sidewell中获取值,那么您在请求完成后填充了隐藏字段,因此,如果您希望在请求中发布隐藏字段的内容,那么您就做错了,这已经完成了,那么我如何才能在hidenfield中获得json值请建议我亲爱的朋友在请求中发送它,就像您处理所有其他fromdata