[Webkit-unassigned] [Bug 34315] New: form POSTing ignores the properly named submit input attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 29 01:27:07 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34315

           Summary: form POSTing ignores the properly named submit input
                    attribute
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: joy+webkit at entuzijast.net


Hi there.

A user reported a problem with Chrome, which I reproduced with Midori,
so I'm filing this on the WebKit library that my Midori package uses.

The automatic platform detection has limited the version choices to some MacOSX
set, which isn't really correct... My Midori and its WebKit library version
1.1.15.2 runs on Linux, while the user's browser identifies as "Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko)
Chrome/3.0.195.38 Safari/532.0".

When a HTML form does this:

<form method="post" name="statsFRM">
<script type="text/javascript">  
<!--
function submitnormal(action) {
        document.statsFRM.action = "?id=something";
        document.statsFRM.submit();
}
-->
</script>
<input type="submit" value="Good stuff" name="ok" onclick="submitnormal()">
<input type="submit" value="Bad stuff" name="rej" onclick="submitnormal()">

...the WebKit-based web browsers fail to POST an element named "ok" or "rej"
to the web server.

I could find no obvious explanation for this omission.

http://www.w3.org/TR/html401/interact/forms.html says fairly clearly:

17.13.3 Processing form data
    When the user submits a form (e.g., by activating a submit button),
    the user agent processes it as follows.
    Step one: Identify the successful controls 
    [...]

17.13.2 Successful controls

    A successful control is "valid" for submission. Every successful
    control has its control name paired with its current value as part
    of the submitted form data set. A successful control must be defined
    within a FORM element and must have a control name.
    [...]
    If a form contains more than one submit button, only the activated
    submit button is successful.
    [...]

Hence, the activated submit button *is* supposed to be successful as well
as submitted via POST.

There seems to be no reason for the 'onclick' attribute to void the success
of the activated submit button, at least not per 18.2.3 'Intrinsic events'
which defines it.

Please fix this. TIA.

FWIW the workaround I had to use consists of passing the omitted name
as submitnormal('ok') or submitnormal('rej') in the onclick attribute,
and then constructing a new hidden input element just before submission:
        wanted_action.setAttribute('type', 'hidden');
        wanted_action.setAttribute('name', action);  
        wanted_action.setAttribute('value', action); 
        document.statsFRM.appendChild(wanted_action);



This is also http://bugs.debian.org/566981

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list