Javascript 未提交输入类型的表单=“提交”;文件";价值观
我正在向asp.net页面提交一个简单表单。除了表单没有提交文件输入值外,其他一切都正常工作Javascript 未提交输入类型的表单=“提交”;文件";价值观,javascript,jquery,html,forms,Javascript,Jquery,Html,Forms,我正在向asp.net页面提交一个简单表单。除了表单没有提交文件输入值外,其他一切都正常工作 <form id="mainform" action="http://<%=Request.Url.Authority %>/ABC/Handler/Submit.aspx" method="post" enctype="multipart/form-data"> <input type='file' id='file_d6'data-mandatory='0' name=
<form id="mainform" action="http://<%=Request.Url.Authority %>/ABC/Handler/Submit.aspx" method="post" enctype="multipart/form-data">
<input type='file' id='file_d6'data-mandatory='0' name='file_d6' style='visibility: hidden; position: absolute;' onchange='showPreview(this)' />
<input type='file' id='file_d7'data-mandatory='0' name='file_d7' style='visibility: hidden; position: absolute;' onchange='showPreview(this)' />
<input style='height: 100%;' type='submit' class='subCtrl' onclick='return isReadyToSubmit();' >
</form>
文件post不在$\u post中,而是在$\u文件数组中。
请尝试打印\u r($\u文件);在PHP脚本的顶部?希望这有帮助文件post不在$\u post中,而是在$\u文件数组中。
请尝试打印\u r($\u文件);在PHP脚本的顶部?希望这有帮助问题不在客户端,而在服务器端。我使用的是
Request.Form.GetKey(intIndex
),它给了我除文件以外的所有其他输入值,但使用Request.files[intIndex]
解决了这个问题。问题不在客户端,而在服务器端。我使用了Request.Form.GetKey(intIndex
)它给了我除文件以外的所有其他输入值,但使用Request.files[intIndex]
解决了这个问题。您应该指定输入有两种类型的输入。您是否获得了其他值,然后type=“file”
?为什么输入文件标签隐藏?@ParthTrivedi:是的,有文本输入和复选框,我在警报框和aspx页面中也得到了它们的值。@guratio:请解释一下。.您应该指定输入有两种输入类型。您是否得到其他值?为什么输入文件标签被隐藏?@ParthTrivedi:是的,有文本输入和复选框,我在警报框和aspx页面中也得到了它们的值。@guratio:请解释一下。.我将此从发布到aspx页面。并使用Request.Form.GetKey(index)获取值解决了这个问题,我使用了错误的方法获取文件,使用Request.Files[index]解决了我的问题。我将此从发布到aspx页面。使用Request.Form.GetKey(index)获取值解决了问题,我使用错误的方法获取文件,使用Request.Files[index]解决了我的问题。
function isReadyToSubmit()
{
$("form#mainform :input").each(function(){
alert($(this).val());
});
return true;
}