File Upload Issue - INPUT type="file" and Use of .click()

  • Thread starter Thread starter HVG
  • Start date Start date
H

HVG

Hi, does anyone know why using ".click()" on a <INPUT type="file"> control
should be a problem?

- the html file selction control is on a very plain webform page with just
the <input type="file"> control and a submit button.
- the ".click()" method is simply used to automatically open the file
selction dialog box so the user doesn't have to click "Browse". (likewise
the form is automatically submitted when the user selects a file).
The wierd effect is:
- When the user first clicks the submit button (after selecting a file),
the form does not submit, and the file selction input control clears
- If the user now selects a file again by clicking the "Browse" button
manually, the process works just fine.

So I guess the file selction control is not executing something internally
when we simulate a "Browse" button click by envoking the "click()" method.
Any ideas much appreciated.

Regards
Hugo
 
Back
Top