如何将input type="file"显示的"浏览" 变成英文的?
点击次数:31 次 发布日期:2008-11-26 22:41:37 作者:源代码网
|
源代码网推荐 源代码网推荐方法一:使用英文Windows系统(这个不太现实,全是废话,不要扔我鸡蛋!) 源代码网推荐 源代码网推荐方法二:隐藏<input type="file" /> ,自己写一个按钮,加上onclick事件,触发 file文件域。 源代码网推荐 源代码网推荐详细讲解下方法二:模拟自定义的效果 源代码网推荐 源代码网推荐1、页面上放个隐藏的<input type=“file” /> 源代码网推荐 源代码网推荐2、然后加上一个文本input(type="text")和一个按钮input(type="button") 源代码网推荐 源代码网推荐3、点按钮的时候调用<input type=file />的click选择文件 源代码网推荐 源代码网推荐4、在<input type=file />的onchange事件中把其值显示在文本input中 源代码网推荐 源代码网推荐5、注意把文本input设置成只读的,防止出错 源代码网推荐<form name=formen> <input type="file" name="picpath" id="picpath" style="display:none" onChange="document.formen.path.value=this.value"> <input name="path" readonly> <input type="button" value="Browse" onclick="document.formen.picpath.click()"> </form> 源代码网供稿. |
