怎么解决文件选择框只能选择文件不能自己输入文件地址? Only for IE:<input type = file onfocusin="alert('请选择文件.');"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sorry,这个事件不可靠,不要用。测了几次,效果不一样,有时竟然还有死循环 <input type = file ><input type = file id=aaa readonly onclick="this.readOnly=false;setTimeout('document.getElementById(\''+this.uniqueID+'\').readOnly=true;',1)"> 让它不能获得焦点不就行了比如<form id="test" name="form" action="test.asp" method="post"><input type="text" name="test" onfocus="javascript:document.forms[0].test2.focus();" /><input type="text" name="test2" /></form>这样第一个就永远不会获得焦点了 <script> function doClick(obj){ obj.readOnly=false; setTimeout('document.getElementById("aaa").readOnly = true',1); }</script><input type = file id=aaa readonly onclick="doClick(this)"> 我觉得不让他获得焦点这个方法不错,呵呵一般<input type="file" /> 都是看本地的文件了,又不是看服务端的文件 <input type="text" id="filename" readonly /><input type="file" id="hiddenfile" style="width:0px;border:0px" onchange="setvalue(this);"/><script type="text/javascript">function setvalue(file){ var filename=document.getElementById("filename"); filename.value=file.value;}</script> pulongywk(天际翔龙)这个好,我喜欢 但是在Firefox下file还是会显示出现,而且也可以修改了 将json数据中的某一条json[i],作为方法的参数传递,可行么? 一个关于js对象设计的问题 是不是类型问题? AjaxPro在外部js文件中使用问题 关于CSS代码的问题,求帮助。 如何获取<a href="">和</a>之间的内容? css的脚本操作,郁闷中。。。 哪位有比较好的右键多级菜单?找了一个,可是不太好用,弹出的位置有时有问题 如何实现光标离开某一个输入框式判断是否是数字? Extjs4+springMVC登陆,大神指导或者帖一个网址给小弟,跪谢 怎样令数字从大到小排列起来? js window.open前,可以先判断open过了,就不open吗?
测了几次,效果不一样,有时竟然还有死循环
<input type = file id=aaa readonly onclick="this.readOnly=false;setTimeout('document.getElementById(\''+this.uniqueID+'\').readOnly=true;',1)">
比如
<form id="test" name="form" action="test.asp" method="post">
<input type="text" name="test" onfocus="javascript:document.forms[0].test2.focus();" />
<input type="text" name="test2" />
</form>
这样第一个就永远不会获得焦点了
function doClick(obj){
obj.readOnly=false;
setTimeout('document.getElementById("aaa").readOnly = true',1);
}
</script>
<input type = file id=aaa readonly onclick="doClick(this)">
一般<input type="file" /> 都是看本地的文件了,又不是看服务端的文件
<script type="text/javascript">
function setvalue(file)
{
var filename=document.getElementById("filename");
filename.value=file.value;
}
</script>