[whatwg] Targetting different anchors after submitting the form

ROBO Design robodesign at gmail.com
Mon Mar 6 07:41:23 PST 2006


Le Mon, 06 Mar 2006 16:25:12 +0200, Mikko Rantalainen  
<mikko.rantalainen at peda.net> a écrit:

> Currently it's possible to do stuff like this
>
> <form action="url#anchor">
> <input name="foo" type="submit">
> <input name="bar" type="submit">
> </form>
>
> and the UA scrolls down to element with id "anchor" on the page returned  
> by the server. It would be nice to be able to set target anchor on  
> per-submit-button basis.
>
> Perhaps something along the lines
>
> <form action="url">
> <input name="foo" type="submit" anchor="xfoo">
> <input name="bar" type="submit" anchor="xbar">
> </form>
>
> would result to action urls "url#xfoo" and "url#xbar" respectively.  
> Perhaps even if the above example had action="url#xzoo", in which case  
> the new anchor attribute would override the fallback behavior.
>
> Is it too much to add a new attribute for something like this?
>
> Note that the server cannot see any of these anchor urls. Only the UA is  
> able to scroll to correct position after receiving output from the  
> server.
>

Maybe adding an attribute for this sole purpose is "too much" to ask for.  
There are isolated cases where this is needed (I myself didn't need this  
ever).

You can, however, modify the action of the form via DOM, by having an  
event listener for the submit event. I suppose you've used this.


-- 
http://www.robodesign.ro
ROBO Design - We bring you the future



More information about the whatwg mailing list