[Web-SIG] empty action attribute with forms in Google Chrome

Randy Syring randy at rcs-comp.com
Tue Apr 28 16:38:54 CEST 2009


Thomas,

Thanks for your info.  Looks like I need to change my SOP.

And you are right, I should find a different list for these questions.  
I am using a python web app, but these questions are generic enough to 
go somewhere else.  Thanks for the kind word and your advice.

--------------------------------------
Randy Syring
RCS Computers & Web Solutions
502-644-4776
http://www.rcs-comp.com

"Whether, then, you eat or drink or 
whatever you do, do all to the glory
of God." 1 Cor 10:31



Thomas Broyer wrote:
> On Mon, Apr 27, 2009 at 11:19 PM, Randy Syring <randy at rcs-comp.com> wrote:
>   
>> For the last four years, I have always used an empty action attribute on my
>> form to make it post back to the current URL.  I almost always validate my
>> HTML and this has never come up as a violation.  Furthermore, I have read
>> various people on the web advocating this practice.
>>
>> Recently, however, I went to use Google Chrome to look at some of my web
>> apps and I noticed that none of my forms work.  In use a <base> tag and
>> empty form attributes.  Whenever I submit a form in Chrome, it gets posted
>> to the root URL (i.e. what I have in my <base> tag).  Am I violating the
>> spec or is this something Google Chrome got wrong?
>>     
>
> You are violating the spec (or, actually, this a bit of a blurry thing
> in the spec re. a "same document reference").
>
>   
>>  What I have works in IE, FF, and Opera.
>>     
>
> Yes, because they're violating the spec too. HTML5 defines the form
> submission to violate the RFC 3986 to make it work like IE, FF and
> Opera:
> http://www.w3.org/TR/html5/forms.html#form-submission-algorithm (step 9)
> The comments there (an HTML comment, look at the source of the page) says:
>     <!-- Don't ask me why. But that's what IE does. It even treats
>     action="" differently from action=" " or action="#" (the latter
>     two resolve to the base URL, the first one resolves to the doc
>     URL). And other browsers concur. It is even required, see e.g.
>       http://bugs.webkit.org/show_bug.cgi?id=7763
>       https://bugzilla.mozilla.org/show_bug.cgi?id=297761
>     -->
>
> (I'm not sure web-sig is the appropriate list for these questions, as
> they're unrelated to Python; maybe http://www.whatwg.org/mailing-list
> or http://forums.whatwg.org/ )
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20090428/c50dd7bf/attachment.htm>


More information about the Web-SIG mailing list