首页  >  文章  >  web前端  >  HTML相关知识和经验的碎片化记录 - yuzhihui

HTML相关知识和经验的碎片化记录 - yuzhihui

WBOY
WBOY原创
2016-05-21 08:42:091269浏览

1、标签input在type="file"时,name是必须属性

<span style="color: #008080;">1</span>  <span style="color: #0000ff;"><span style="color: #800000;">form </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">MainFileUpload" name</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">MainFileUpload" enctype</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">multipart/form-data"</span><span style="color: #0000ff;">></span>                                                
<span style="color: #008080;">2</span>   <span style="color: #0000ff;"><span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">cls_MainFileUpload"</span><span style="color: #0000ff;">></span>                                                       
<span style="color: #008080;">3</span>     <span style="color: #0000ff;"><span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">cls_MainFileUpload2"</span><span style="color: #0000ff;">></span>
<span style="color: #008080;">4</span>      <span style="color: #0000ff;"><span style="color: #800000;">img </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">MainFileUploadBtnImg" class</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">cls_MainFileUploadBtnImg" alt</span><span style="color: #0000ff;">=""</span><span style="color: #ff0000;"> src</span><span style="color: #0000ff;">=""</span> <span style="color: #0000ff;">/></span>                                                                                                     <span style="color: #0000ff;"><span style="color: #800000;">input </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">cls_FileUpload" type</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">file"" id</span><span style="color: #0000ff;">="</span><span style="color: #ff0000;">{0}_FileUpload" name</span><span style="color: #0000ff;">="FileUpload"</span><span style="color: #0000ff;">/></span>                                                   
<span style="color: #008080;">5</span>      <span style="color: #0000ff;"></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span>                                                
<span style="color: #008080;">6</span>   <span style="color: #0000ff;"></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span>
<span style="color: #008080;">7</span>  <span style="color: #0000ff;"></span><span style="color: #800000;">form</span><span style="color: #0000ff;">></span></span></span></span></span></span>
<span style="font-size: 14px;">标签input在type="file"时,name是必须属性,如果没有name属性,那么在表单提交时,文件不能被提交(即上传)</span><br><span style="font-size: 14px;">......</span>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn