[whatwg] A thought: <a href="..." method="post">

Ian Hickson ian at hixie.ch
Fri May 6 17:50:22 PDT 2005


On Fri, 6 May 2005, Ian Bicking wrote:
>
> A related extension might be a method attribute to anchor tags.  One might
> expect <a href="form?delete=10" method="POST">[delete this]</a> to do a post
> request to "form" with a request body of "delete=10".

This has been brought up several times, although I don't remember the past 
reasonings for it not being added to the spec.

The main problem I have with it is that it feels wrong. (Yup, I'm giving 
really good arguments today!) The <a> element is supposed to be a 
hyperlink -- but if you say it can be a form submission, that breaks that 
model. Fundamentally, I feel users should be able to always treat 
hyperlinks as safe-to-click -- they are links.

So I would say that any time an author needs something to have UI that is 
a submission, it should be clearly submission UI. And that would be a 
<button> or <input>, not an <a> hyperlink.

In short, I would say that <a href="delete">delete</a> is fundamentally 
wrong.

But having said that, a lot of people have asked for this kind of thing. 
Should we give up on our ideals in this particular case and just say that 
the "method" attribute can change the <a> from being a simple hyperlink to 
being part of a submission UI?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list