A SELECT element with no name is submitted. A SELECT with a selected, disabled OPTION submits the disabled OPTION. This results in the unsuccessful controls generating values in query strings and invalid query strings: ?=invalid&=&wrong=disabled#done * "invalid" is the selected OPTION of a SELECT that has no name * "&=" is the selected OPTION with no value of a SELECT that has no name * "wrong=disabled" is the selected OPTION with the value "disabled" of a SELECT with the name "wrong" Instead, the submit with no name should not be submitted and disabled OPTIONS should not be submitted. If the selected option does not have a value, the browser may consider the select to be unsuccessful. This would result in either the query string "wrong=" or no query string. If there is no OPTION selected, the browser may select the first OPTION or the first enabled OPTION. This would result in the test case: 1) (no query string) 2) wrong=enabled (only if the enabled OPTION were default selected). | If a control doesn't have a current value when the form is | submitted user agents are not required to treat it as a successful | control." [1] [1] HTML 4.01, Forms, Successful Controls. http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2
Created attachment 22499 [details] Test Case Showing Problem ?=invalid&=&wrong=disabled#done Also of note: in Firefox, the disabled options are not selected unless they have the selected attribute. This is perfectly valid and affords the developer more control and flexibility. Safari Version 3.1.1 (4525.18), navigator.userAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18
Created attachment 22501 [details] Test Case Showing Problem Bring in the bug id "id=" param for bugs.webkit.org bug id.
<rdar://problem/6104686>
Created attachment 22512 [details] Test Case Showing Problem
Created attachment 22517 [details] Test Case Showing Problem
Created attachment 22519 [details] Test Case Showing Problem
There is an identical bug at bugs.kde.org: B u g 148981: Do not submit disabled option in combobox https://bugs.kde.org/show_bug.cgi?id=148981
Created attachment 27697 [details] proposed fix This patch fixes the "select with no name" issue. As far as "disabled selected option" goes, this is a separate issue that needs to be discussed in a separate bug, especially since we match IE behavior here.
Comment on attachment 27697 [details] proposed fix Oops, I clicked the wrong option when submitting the patch! Marking for review now.
Comment on attachment 27697 [details] proposed fix r=me
Committed revision 41135.
*** Bug 19005 has been marked as a duplicate of this bug. ***
Created attachment 59190 [details] Simpler testcase. Submitting better testcase to FIXED bug for future reference/clarity -- the previous testcase was confusing.
*** Bug 21478 has been marked as a duplicate of this bug. ***