2017-08-10 20:42
浏览 272

Bootstrap - 提交文件输入表单?

I have this Bootstrap from model, and I do not know why the submit button does not sent the file, it sent nothing.

<form action="myPage.php" class="form-horizontal form-bordered">
    <div class="form-body">
        <div class="form-group">
            <div class="col-md-6 col-md-offset-3">
                <div class="fileinput fileinput-new" data-provides="fileinput">
                    <div class="input-group input-large">
                        <div class="form-control uneditable-input input-fixed input-medium" data-trigger="fileinput">
                            <i class="fa fa-file fileinput-exists"></i>&nbsp;
                                <span class="fileinput-filename"> </span>
                            <span class="input-group-addon btn default btn-file">
                            <span class="fileinput-new"> CHOOSE FILE </span>
                            <span class="fileinput-exists"> CHANGE </span>
                            <input type="file" name="..."> </span>
                            <a href="javascript:;" class="input-group-addon btn red fileinput-exists" data-dismiss="fileinput"> DELETE </a>
     <div class="form-actions">
         <div class="row">
             <div class="col-md-6 col-md-offset-3">
                 <a href="javascript:;" class="btn btn-outline grey-salsa">Cancel</a>

all links are available

图片转代码服务由CSDN问答提供 功能建议

我有这个模型的Bootstrap,我不知道为什么提交按钮 没有发送文件,它什么都没发送。

 &lt; form action =“myPage.php”class =“form-horizo​​ntal form-b​​ordered”&gt; 
&lt; div  class =“form-b​​ody”&gt; 
&lt; div class =“form-group”&gt; 
&lt; div class =“col-md-6 col-md-offset-3”&gt; 
&lt;  div class =“fileinput fileinput-new”data-provide =“fileinput”&gt; 
&lt; div class =“input-group input-large”&gt; 
&lt; div class =“form-control uneditable-input input  -fixed input-medium“data-trigger =”fileinput“&gt; 
&lt; i class =”fa fa-file fileinput-exists“&gt;&lt; / i&gt;&amp; nbsp; 
&lt; span class =” 的FileInput文件名“&GT;  &lt; / span&gt; 
&lt; / div&gt; 
&lt; span class =“input-group-addon btn default btn-file”&gt; 
&lt; span class =“fileinput-new”&gt; 选择文件&lt; / span&gt; 
&lt; span class =“fileinput-exists”&gt;  CHANGE&lt; / span&gt; 
&lt; input type =“file”name =“...”&gt;  &lt; / span&gt; 
&lt; a href =“javascript:;”  class =“input-group-addon btn red fileinput-exists”data-dismiss =“fileinput”&gt;  DELETE&lt; / a&gt; 
&lt; / div&gt; 
&lt; / div&gt; 
&lt; / div&gt; 
&lt; / div&gt; 
&lt; / div&gt; 
&lt; div class =“表单 -actions“&gt; 
&lt; div class =”row“&gt; 
&lt; div class =”col-md-6 col-md-offset-3“&gt; 
&lt; a href =”javascript:  ;”  class =“btn btn-outline grey-salsa”&gt;取消&lt; / a&gt; 
&lt; / div&gt; 
&lt; / div&gt; 
&lt; / div&gt; 
&lt; / form&gt; 


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongtang7347 2017-08-10 21:01

    Try this code : <form action="myPage.php" method="post" enctype="multipart/form-data">

    <div class="form-group"> <label for="exampleInputFile">CHOOSE FILE</label> <input type="file" id="exampleInputFile"> <p class="help-block">Example block-level help text here.</p> </div>

    <button type="submit" class="btn btn-default">Submit</button> </form>

    点赞 打赏 评论
  • dongnuochen9449 2017-08-10 20:45

    you are using link ,You need submit button <button type="submit" class="btn btn-default">Submit</button> and your form is messing ">" <form action="myPage.php" class="form-horizontal form-bordered"

    点赞 打赏 评论

相关推荐 更多相似问题