Re: can't read value from <input type=file> in netscape
- From: Randy Webb <HikksNotAtHome@xxxxxxx>
- Date: Sat, 29 Oct 2005 16:22:19 -0400
myahact@xxxxxxxx said the following on 10/29/2005 3:54 PM:
Hello,
I have <input type=file id=myfile> in a form. In IE I can read the value thusly:
document.getElementById("myfile").value
But thusly returns "" in Mozilla/Netscape.
I also tried through the DOM but
node.value was "" node.text was ""
Can I not read this value in Moz/NS?
Yes, you use a name attribute and the forms collection:
<script type="text/javascript">
function getValue(formRef){
alert(formRef.fileInput.value)
}
</script><form name="myForm">
<input type="file" onchange="alert(this.value)" name="fileInput"><br />
<input type="button" value="Get The Value"
onclick="getValue(this.form)">-- Randy comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly .
- References:
- can't read value from <input type=file> in netscape
- From: myahact
- can't read value from <input type=file> in netscape
- Prev by Date: can't read value from <input type=file> in netscape
- Next by Date: Re: Looping through variable number of arrays variable times? - RUNTIME???
- Previous by thread: can't read value from <input type=file> in netscape
- Index(es):