更改FileUpload控件中browse按钮的显示文字

1.

<SCRIPT LANGUAGE="JavaScript"> <!-- function ShowBrowse() { var file1=document.getElementById("file1"); if(file1) { file1.click(); } } function ShowFilename(o) { var filename=document.getElementById("filename"); if(filename) { filename.value=o.value; } } //--> </SCRIPT> <input id="file1" type="file" onpropertychange="ShowFilename(this);" style="display:none" mce_style="display:none" /> <input id="filename" /><button οnclick="ShowBrowse()"> 浏览... </button>

2.

<html> <head id="Head1" runat="server"> <title>无标题页</title> <mce:style type="text/css"><!-- a.addfile { background-image: url(http://p.mail.163.com/js31style/lib/0703131650/163blue/f1.gif); background-repeat: no-repeat; background-position: -823px -17px; display: block; float: left; height: 25px; margin-top: -1px; position: relative; text-decoration: none; top: 0pt; width: 65px; overflow:hidden; } a.addfile:hover { background-position: -911px -17px; } input.addfile { cursor: pointer !important; height: 25px; left: -6px; filter: alpha(opacity=0); position: absolute; width: 0px; z-index: -1; } --></mce:style><style type="text/css" mce_bogus="1"> a.addfile { background-image: url(http://p.mail.163.com/js31style/lib/0703131650/163blue/f1.gif); background-repeat: no-repeat; background-position: -823px -17px; display: block; float: left; height: 25px; margin-top: -1px; position: relative; text-decoration: none; top: 0pt; width: 65px; overflow:hidden; } a.addfile:hover { background-position: -911px -17px; } input.addfile { cursor: pointer !important; height: 25px; left: -6px; filter: alpha(opacity=0); position: absolute; width: 0px; z-index: -1; } </style> </head> <body> <form id="form1" runat="server" enctype="multipart/form-data"> <div> <a href="#" mce_href="#" class="addfile" id="al"> <input id="my_file_element" class="addfile" runat="server" type="file" name="file_1" size="1" title="点击选择附件" /> </a> </div> </form> </body> </html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值