<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>hello</title>
</head><body>
<form method="post" enctype="multipart/form-data" action="#" >
<br>
<input name="filePath" size="100" style="color: green;border: 1px dotted green">
<input type="button" name="aButton" value="Browse..." onclick="clickFileControl()">
<br>
<input type="file" name="file" style="display: none;"
onchange="filePath.value=this.value" style="border: 1px dotted green">
<br><br>
<input type="button" name="aButton" value="Submit Form" onclick="submitForm()">
</form></body>
</html>
<script language="JavaScript">
function clickFileControl(){
document.forms[0].file.click();
document.forms[0].filePath.value = document.forms[0].file.value;
//alert(document.forms[0].file.value);
}
function submitForm(){
alert(document.forms[0].file.value);
document.forms[0].submit();
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>hello</title>
</head><body>
<form method="post" enctype="multipart/form-data" action="#" >
<br>
<input name="filePath" size="100" style="color: green;border: 1px dotted green">
<input type="button" name="aButton" value="Browse..." onclick="clickFileControl()">
<br>
<input type="file" name="file" style="display: none;"
onchange="filePath.value=this.value" style="border: 1px dotted green">
<br><br>
<input type="button" name="aButton" value="Submit Form" onclick="submitForm()">
</form></body>
</html>
<script language="JavaScript">
function clickFileControl(){
document.forms[0].file.click();
document.forms[0].filePath.value = document.forms[0].file.value;
//alert(document.forms[0].file.value);
}
function submitForm(){
alert(document.forms[0].file.value);
document.forms[0].submit();
}
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货