Input Type=file default Value

Hallo everybody,

we are facing the following problem: we want to provide an input element of
type file with a default value that should be displayed by default (actually
it is the current value of a specific attribute). While the value-property
is read only in IE5-6, we tried to set the defaultValue-property through

var oInput = document.createElement("INPUT");
oInput.type = "file";
oInput.defaultValue = _someValue_;

Unfortunately, the default value is not displayed. The documentation states,
that changing the defaultValue has no effect until a form was reseted, but
in our test case this did not happened.

Does anybody know, how to force a file input element to show an initial
value or does somebody has a workaround for this?


Robert Tanev

Received on Thursday, 14 February 2002 08:32:02 UTC