日期:2014-05-18  浏览次数:20808 次

<input type="file" name="xls_filename">如何实现不让手输文件路径的功能,一点浏览就可以浏览文件
<input   type= "file "   name= "xls_filename "> 如何实现不让手输文件路径的功能,一点浏览就可以浏览文件

为什么我这样提交,提交不了


<script>
function   doClick(obj){
obj.readOnly=false;
setTimeout( 'document.getElementById( "aaa ").readOnly   =   true ',1);
}

function   ButClick(){
      //   if(document.form1.txtFakeText.value== " "){

//if(document.getElementById( "xls_filename ").value== " "){
//alert( "请选择excel文件! ");
//}else{
document.form1.action   =   "dlfxb.jsp ";
document.form1.submit();
//}
}

</script>


  <form   name= "form1 "   method= "post "   action= " ">
<input     type   =   file   id=aaa   readonly   onclick= "doClick(this) ">
<input   type= "button "   name= "Mits "   onclick= "ButClick() "   value= "导入 "   class=go-wenbenkuang>
</form>
提交不了,总是空,js也报错,不知道为什么



------解决方案--------------------
这个可以用js来实现呀
------解决方案--------------------
你标签中用的name,而JS中用的getElementById( ' '),可能不行,JS中用getElementsByName( ' ')[0]来做试试