<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也报错,不知道为什么
<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也报错,不知道为什么
<html>
<head>
<title>File Upload Example</title>
<script language="JavaScript" type="text/javascript">
function ButClick(){
//document.form1.action = "dlfxb.jsp";
document.form1.submit(); }
function HandleFileButtonClick()
{
document.frmUpload.myFile.click();
document.frmUpload.txtFakeText.value = document.frmUpload.myFile.value;
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<input type="file" name="xls_filename" style="display: ">
<input type="text" name="txtFakeText" readonly="true" class=go-wenbenkuang >
<input type="button" onclick="HandleFileButtonClick();" value="浏览Excel文件" class=go-wenbenkuang>
<input type="button" name="Mits" onclick="ButClick()" value="导入" class=go-wenbenkuang> </form>
</body>
</html>