---
title: "input type=file 标签禁止让用户手动输入"
author: "guoweimail"
date: "2012-02-21T14:08:49Z"
tags: []
categories: ["Web前端"]
slug: "input-type-file"
draft: false
lastmod: "2012-02-21T14:08:49Z"
id: 1415565
url: "https://mrwillgo.iteye.com/blog/1415565"
---

```
<input name="filePath" id="filePath" type="file" size="40" onkeydown="return false" onkeyup="return false">
```

 

在IE8下是不能手动输入的，但是在IE6下是可以的。所以可以通过以上的js控制来禁止用户手动输入。