<a id="avatar_upload_button" href="#" onclick="openfile();" class="upload_avatar btn btn18 wbtn">
        <strong>上传头像</strong><span></span></a>
[/color]
想通过点击“上传头像”提交表单,但老是提示拒绝访问,谁能给我一个DEMO

解决方案 »

  1.   

    含有文件控件的表单都不能由JS来控制提交,必须点击表单中的submit按钮才能提交。
      

  2.   

    直接通过表单上传图片文件啊。
    <form enctype="multipart/form-data">
    <input type="file" name="face" />
        <input type="submit" value="上传头像" />
    </form>
      

  3.   

    通过form + input type = file 来上传楼主 用的什么后台脚本,搜下相关的上传教程比如php 可以参考下
    http://www.w3school.com.cn/php/php_file_upload.asp
      

  4.   

    <input id="Attach" type="file" name="Attach" style=" display:none" />
    <a onclick='javascript:document.getElementById("Attach").click'>
      

  5.   


    ++
    input type="file"