[whatwg] A thought: <a href="..." method="post">
Daniel O'Connor
daniel.oconnor at gmail.com
Fri May 6 21:20:49 PDT 2005
Is this perhaps a problem that is solved with rel="nofollow"?
I can see where it would be beneficial to have a profile of link
relationship types to denote functional links.
ie
<a href="" rel="edit nofollow admin"></a>
to say "this is a link which is used for editing and administration,
don't follow it".
That neatly describes the link functionality in a set of known terms,
and avoid a lot of the mess with prefetching...
On 5/7/05, Ian Bicking <ianb at colorstudy.com> wrote:
> Ian Hickson wrote:
> > 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.
>
> I'd basically agree. Which perhaps makes the argument stronger -- I
> agree, and yet when I'm actually writing an application I frequently do
> this anyway ;) This is such a common practice, and at least
> method="post" offers a path to get people to move in the right
> direction. Some of the motivations for using anchors is removed by Web
> Forms, but not entirely.
>
> It's not 100% clear to me how you'd do the equivalent with <button>. I
> guess this is what I'd come up with...
>
> <form action="form" method="post" id="delete"></form>
> ...
> <button form="delete" name="delete" value="10">delete this</button>
>
> And that's not too bad. If you really didn't want it to look like a
> button, you could go out of your way to use CSS to do that. If the UA
> allowed it (if the UA actually allowed that). But one major reasons for
> buttons not being used (besides currently requiring Javascript) is that
> they don't look very nice in long lists, so control over appearance is
> important. But using anchors for actions is so engrained in web
> developers that it might not be enough of a carrot.
>
> > 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?
>
> I must admit I don't know what you mean by "submission UI". If you
> mean, act like a submit button for the containing form, then no, people
> use anchors specifically to avoid that. Or do you mean something else?
>
> --
> Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
>
--
http://www.ahsonline.com.au/dod/FOAF.rdf
More information about the whatwg
mailing list