Discussion Locked

Changing a form value via. javascript.

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I am trying to use Javascript to manipulate a file input box. I can successfully manipulate other input boxes via the document.formName.inputName.value variable, however, for whatever reason, file input values seems to be read-only. Is there some other way to manipulate a file input form field?

Thanks for your help.

3 replies

by briancgin

The browser will not allow arbitrary settings of the upload file. This could be used to upload files without the user knowing it, a form hidden down at the bottom of a page, using onSubmit() events to grab files without client's acknowledgement.

by bucky kaufman (mcsd)

The fact that the file selector element is not scriptable this way is a feature - not a bug. There are a variety of ways to implement your desired functionality.

You can build your own Java Applet and/or ActiveX controls and digitally sign them. If your users trust you, they'll let you do this - if they don't they won't have to.

This discussion is closed to new replies.