[whatwg] Targetting different anchors after submitting the form

Ric Hardacre whatwg at cycloid.f9.co.uk
Mon Mar 6 09:16:21 PST 2006



Anne van Kesteren wrote:
> Quoting ROBO Design <robodesign at gmail.com>:
>> <...>
>>> <form action="order_place.asp">
>>> <input type="submit" value="PLACE ORDER">
>>> <input type="submit" value="SAVE QUOTE" action="quote_add.asp#thanks">
>>> <input type="submit" value="RECALCULATE TOTALS" action="#here">
>>> </form>
> 
> What's wrong with using the "form" attribute to point to multiple forms? 
> One
> submits to one place, the other submits to another place.
> 
> 

whoops, sent my last reply from the wrong from address, mod might ignore 
it but i've read the spec. if i want all the data in my basket to 
associate with my multiple forms i have to specify, for each and every 
one (unless there's some default=all forms possibility as opposed to 
default=none) the form thus

<input type="hidden" id="prod_00_name" value="pie" form="saveform 
quoteform totalform">
<input type="hidden" id="prod_00_ea" value="1.99" form="saveform 
quoteform totalform">
<input type="hidden" id="prod_00_qty" value="4" form="saveform quoteform 
totalform">
<input type="hidden" id="prod_01_name" value="beer" form="saveform 
quoteform totalform">

[several dozen other elements along the lines of the above]

<input type="submit" value="PLACE ORDER" form="saveform">
<input type="submit" value="SAVE QUOTE" form="quoteform">
<input type="submit" value="RECALCULATE TOTALS" form="totalform">

now obviously this is an extreme example; i could just associate all 
three forms with a fieldset and house my cart/basket within that. but 
the fieldset is a block element and it may well end up presenting a 
similar problem that moving the form definition to the head was meant to 
solve. (though in my first example i did use a block-level form).

ric hardacre
http://www.cyclomedia.co.uk/






More information about the whatwg mailing list