Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- & in one action?
April 4, 2005, 10:34 am
rate this thread
Does anyone have a solution to use the <input type="file"
id="filechooser"> and the <input type="submit" id="submitbutton"> in 1
submitbutton click. In this function i call the filechooser.click()
event and after this i call the functions to activate the progressbar
of the upload.
This doesn't seems to work:(
Has anyone got an idea of what i can do?
Re: & in one action?
Firstly, please don't multi-post. There's no reason to send the same
message twice, just with a different subject.
> Does anyone have a solution to use the <input type="file"
> id="filechooser"> and the <input type="submit" id="submitbutton"> in 1
> button click?
It's not possible to simulate a click on the file upload control when a
user clicks submit, but you may be able to add an onchange event
listener to the file upload control, which automatcially submits when
the user selects a file. However, this would be a very bad user
interface for the following reasons:
1. It changes the expected behaviour of the control
2. If a user selects the wrong file by mistake, it does not give the
user a chance to change their mind before submitting.
3. Using onchange may not allow a user to manually type in a file path,
as the form may submit as soon as they start typing. Although, this
depends upon when the change event is fired by the user agent.
If you plan to go ahead with this regardless, I suggest you ask in a
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox