Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未提交输入类型的表单=“提交”;文件";价值观_Javascript_Jquery_Html_Forms - Fatal编程技术网

Javascript 未提交输入类型的表单=“提交”;文件";价值观

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=

我正在向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='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;
}