>웹 프론트엔드 >HTML 튜토리얼 >HTML相关知识和经验的碎片化记录 - yuzhihui

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

WBOY
WBOY원래의
2016-05-21 08:42:091293검색

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으로 문의하세요.