I am trying to upload files from the client machine to the server.
So my page will load with one input box and one upload box(input with type=file)
I could do it just with an input box with type file but for the sake of styling issues I have to use an input box in sync with an upload box.
This approach works with the controls that are already on the page. My upload page can add upload fields dynamically. when such upload fields are dynamically added I have to specify the onchange event so as the file selection is done in the upload box the value in the uploadbox is transferred into the input box.
uploadbox.onchange->inputbox.value=this.value like that.As the upload and input boxes are created dynamically their names will also be dynamic, that is one additional issue I am facing. Any comments?
I don't know that I completely understand what you're trying to do, however since it seems like you're trying to mix javascript and input boxes of type file then you're probably gonna hit a brick wall. The contents of an input box of type file cannot be modified by javascript.
I think bendjoe only wants to extract the [tt]value[/tt], not to modify it. Anyway, FireFox certainly not gives out the full value to JavaScript, only the file name part.
Neither I am sure I understand the requirements, but I think Peter-Paul Koch's article Styling an input type="file" could give some hint.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.