zoukankan      html  css  js  c++  java
  • input file 文件上传控件隐藏后用button触发它的click事件文件传不上去的解决方案

    <HTML> <HEAD> <TITLE>upload</TITLE> <style> <!-- .addfileA{ position:relative; cursor:hand; text-decoration:none; background-image: url('C:\WINDOWS\Zapotec.bmp'); width:20px; } .addfileI { cursor:hand; position:relative; left:0px; width:20px; background-color: blue; opacity:0; filter:alpha(opacity=0) } --> </style> </HEAD> <BODY> <FORM METHOD=POST ACTION="http://localhost:8080/upload.jsp" enctype="multipart/form-data"> <A hideFocus class=addfileA id=aComposeAttach href="#">&nbsp;<INPUT hideFocus class=addfileI type=file size=1 name="FF" onchange="this.form.submit()"></A> <INPUT TYPE="submit" value="提交"> </FORM> </BODY>

    </HTML>

    Input type=file 这个控件是不可以用JavaScript触发click事件的,否则是不生效的。我代码其实是让用户看起来点击的是图片,但是实际上点击的是那个透明的Input Type=file 

  • 相关阅读:
    sqli-labs(43)
    sqli-labs(42)
    sqli-labs(41) and 两php函数的讲解
    php的mysql语法
    msf
    域的建立过程
    sqli-labs(40)
    sqli-labs(39)
    sqli-labs(38)
    虚拟化之docker
  • 原文地址:https://www.cnblogs.com/top5/p/2106801.html
Copyright © 2011-2022 走看看