|
Hello all,
I have a file input on my page that I need to clear the value of in response to a button click. But setting the value of it to "" does not work.
Here is what I have:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>test bed</title>
<script language="Javascript">
function clearIt(){
file = document.getElementById('filTest');
file.value = '';
alert(file.value);
}
</script>
</head>
<body>
<p>
<form name="ignoreThis">
<p>
<input type="file" id="filTest">
<br><input type="button" value="clear" onclick="clearIt();">
</p>
</form>
</p>
</form>
</body>
</html>
|
|
If you open the page in a browser and click the browse button to select a file then click clear, you would expect to get an alert box that says nothing. But it gives me the original value....and the value in the control does not change.
I have also tried setting the value to null and "", and "nothing". No change ever shows.
Anyone have any ideas?
Thanks.
James.
|
|
|
|
|
|
|
|
|
|