Is it possible to do a POST from just an
There is no way to
a element using only HTML.
As can be seen from this DTD fragment (HTML 4.01 spec):
<!ELEMENT A - - (%inline;)* -(A) -- anchor --> <!ATTLIST A %attrs; -- %coreattrs, %i18n, %events -- charset %Charset; #IMPLIED -- char encoding of linked resource -- type %ContentType; #IMPLIED -- advisory content type -- name CDATA #IMPLIED -- named link end -- href %URI; #IMPLIED -- URI for linked resource -- hreflang %LanguageCode; #IMPLIED -- language code -- rel %LinkTypes; #IMPLIED -- forward link types -- rev %LinkTypes; #IMPLIED -- reverse link types -- accesskey %Character; #IMPLIED -- accessibility key character -- shape %Shape; rect -- for use with client-side image maps -- coords %Coords; #IMPLIED -- for use with client-side image maps -- tabindex NUMBER #IMPLIED -- position in tabbing order -- onfocus %Script; #IMPLIED -- the element got the focus -- onblur %Script; #IMPLIED -- the element lost the focus -- >
There is no attribute that controls whether to use
GET with an
You have to script it, if you want to abuse the semantics.
Not really, no. You can, however, do something like this:
<form action="theUrl" method="POST"> <input type="hidden" name="param1" value="val" /> <input type="hidden" name="param2" value="val2" /> <a href="#" onclick="this.parentNode.submit()">Go to that link!</a> </form>
You should find a better way, though. This one does not degrade gracefully.
You can use CSS to make an
<input type="submit"> look like a hyperlink.
No there’s no way to do this without the use of scripting. Although you can use CSS to style a standard Submit button to look and act more like an tag.
You’d basically send the GET request (with the A) to some server file, which would change the GET vars to POST and then re-submit instantly (redirect location). But that would mess the referer stats I think.