如何隐藏Html文件上传中的文本字段 [英] How to hide text field in Html File Upload

查看:119
本文介绍了如何隐藏Html文件上传中的文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何隐藏标准html文件上传标签的文本字段部分

I am wondering how to hide the text field portion of a standard html file upload tag

例如

<input type="file" name="somename" size="chars"> 

这显然会生成一个文本字段,该字段旁边是一个浏览按钮...我想隐藏文本字段部分,但保留按钮。

This generates obviously a text field and next to that field is a browse button... I want to hide the text field part but keep the button.

推荐答案

我建议隐藏整个事物,

I'd recommend hiding the whole thing and putting a separate button object which, when clicked, will end up clicking the input's browse button.

您可以使用CSS和javascript来执行此操作 - 查看这篇文章(实际上是我第二次使用这个参考资料)。

You can do this with CSS and javascript -- check out this article (actually the second time I've used this reference today).

这篇关于如何隐藏Html文件上传中的文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆