Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1455 In side a JavaScript function (for Netscape Navigator 3.04) when I do document.form.file.value where file is of type input="file" with enctype="multipart/form-data" it does not return any value.

You are here: irt.org | FAQ | JavaScript | Bugs | Q1455 [ previous next ]

It is a known bug, and you are lucky, it has a workaround:

<script language="JavaScript>
function showFile(theForm) {
    theForm.file1.focus();
    theForm.file1.blur();
    Test = '' + theForm.file1.value;
    alert(Test);
}
//--></script>

<form name=uploadform enctype="multipart/form-data">
<input type="file" name="file1">
<input type="button" value="Click" onClick="showFile(this.form)">
</form>

©2018 Martin Webb