Bug 8584

Summary: File info is not POSTed when an onsubmit handler is present on the form
Product: WebKit Reporter: Seth Fitzsimmons <seth>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, ddkilzer
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Upload form containing onsubmit
none
PHP script demonstrating the absence of the "file" property
none
Better diagnostic script
none
Upload form containing onsubmit none

Seth Fitzsimmons
Reported 2006-04-25 06:27:51 PDT
Adding a onsubmit handler to a multipart form with a file input causes the file to not be POSTed to the server.
Attachments
Upload form containing onsubmit (837 bytes, text/html)
2006-04-25 06:28 PDT, Seth Fitzsimmons
no flags
PHP script demonstrating the absence of the "file" property (30 bytes, text/plain)
2006-04-25 06:29 PDT, Seth Fitzsimmons
no flags
Better diagnostic script (124 bytes, text/plain)
2006-04-25 10:32 PDT, Seth Fitzsimmons
no flags
Upload form containing onsubmit (731 bytes, text/html)
2006-04-25 19:31 PDT, Seth Fitzsimmons
no flags
Seth Fitzsimmons
Comment 1 2006-04-25 06:28:29 PDT
Created attachment 7956 [details] Upload form containing onsubmit
Seth Fitzsimmons
Comment 2 2006-04-25 06:29:06 PDT
Created attachment 7957 [details] PHP script demonstrating the absence of the "file" property
Alexey Proskuryakov
Comment 3 2006-04-25 10:20:19 PDT
I have tried removing the onsubmit handler, and the output from the script didn't change ("Array ( [title] => sometitle )"). Furthermore, it's the same in Firefox. Could you please clarify how to reproduce the problem?
Seth Fitzsimmons
Comment 4 2006-04-25 10:30:52 PDT
Er, sorry. I need to provide a better reduction.
Seth Fitzsimmons
Comment 5 2006-04-25 10:32:28 PDT
Created attachment 7960 [details] Better diagnostic script
Alexey Proskuryakov
Comment 6 2006-04-25 10:52:45 PDT
The updated script works as expected for me (i.e., I cannot reproduce the bug): Request: Array ( [title] => sometitle ) Files: Array ( [file] => Array ( [name] => onsubmit.php [type] => text/php [tmp_name] => /var/tmp/php7ISaZd [error] => 0 [size] => 124 ) ) I'm using Mac OS X 10.4.5 with Apache, accessing it locally.
Seth Fitzsimmons
Comment 7 2006-04-25 11:34:49 PDT
That's correct; I need to track down the problem more fully when I have some more time; in the meantime I figured I should make the diagnostic script clear that it _is_ working this way.
Seth Fitzsimmons
Comment 8 2006-04-25 19:31:01 PDT
Created attachment 7966 [details] Upload form containing onsubmit
Seth Fitzsimmons
Comment 9 2006-04-25 19:33:09 PDT
Upon further investigation, this only happens if the form being submitted has its visibility set to "none" (demonstrated in attachment 7966 [details]).
Alexey Proskuryakov
Comment 10 2006-04-25 21:44:55 PDT
Yes, display:none file input controls are a known bug... Judging form the comments there, WebKit may be not violating the standard, but it is clearly in disagreement with other browsers. *** This bug has been marked as a duplicate of 5196 ***
Note You need to log in before you can comment on or make changes to this bug.