带有类型文件的HTML“input”标记在移动设备中不起作用。怎么解决?

问题描述 投票:-1回答:1

带有类型文件的HTML“input”标记在移动设备中不起作用。怎么解决?

帮我解决一下。

提前致谢。

我的代码如下:

<body>
  <h1><font color="white">REPORT</font></h1>
  <br><br>
  <form id="f1" action="summary.html">
    <p>
      <b><font color="white">Project Name:</font></b><br>
      <input type="text" name="project" id="project" value="" required="required">
    </p>
    <p>
      <b><font color="white">Report:</font></b><br>
      <input type="file" accept="application/pdf">
    </p>
    <p>
      <button type="button" onclick="submitData()">Submit</button>
    </p>
  </form>
</body>

编辑1:我的JS代码如下:

function submitData() { 
  var proj = document.getElementById("project").value; 
  if( proj == "") alert("Please enter the required field");
  else document.getElementById("f1").submit();
}
android html
1个回答
0
投票

我在我的移动Chrome浏览器上试用它没有问题look at the photo

© www.soinside.com 2019 - 2024. All rights reserved.