<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#comment-start/2005-05-08/1-2'
         s:name='comment-start/2005-05-08/1-2'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:content>Simon, thanks for your comment.  I had not considered the form-in-a-form case.  But, now that I think about it, I don&apos;t think it&apos;s as limiting as&#xA;it might seem.  Let me explain.&#xA;&#xA;When we want to trigger an action and we&apos;re already inside of a form,&#xA;there are really two cases to consider.  The first case is when the&#xA;action depends on the state of the entire form.  This case is actually&#xA;the common case for plain old forms: Click a submission button and the&#xA;entire form is processed.  For this case, just create a submission&#xA;button with the usual X/HTML markup:&#xA;&#xA;{code:xml} &lt;input type=&quot;submit&quot; value=&quot;Process your Order&quot;/&gt; {code}&#xA;&#xA;No need to use ~~button_to~~ or anything like it.  Normal markup works&#xA;just fine.&#xA;&#xA;The second case is the interesting one.  It&apos;s when we want the action&#xA;to operate only upon local state, acting in effect as an escape hatch&#xA;from the form.  (E.g., consider the Add To Cart buttons in Amazon Wish&#xA;Lists.) That is, we do not care about the state of the entire form,&#xA;just the local context of the action (e.g., a particular item in the&#xA;wish list to add to the cart).  This is where many people turn to&#xA;hypertext links, encoding the local state into the URL.  But there are&#xA;other options.&#xA;&#xA;One option is to use a normal form-submission button, just like in the&#xA;common case, but with a twist: We additionally encode the local state&#xA;into the button (e.g., via its name attribute).  When the server&#xA;processes the request, it simply ignores the form state and processes&#xA;the encoded local state.  The downside is that if the form state is&#xA;large, the POST requests will be correspondingly wasteful.&#xA;Nevertheless, in many cases the waste may be within acceptable limits.&#xA;&#xA;Another option is to use a link inside of the form to confirm &amp;#8211;&#xA;not to trigger &amp;#8211; the local action.  The link points to a&#xA;confirmation page that summarizes the action to be performed in a&#xA;form. If the user confirms the action, the form is posted, triggering&#xA;the action.  The upside is that if the action is potentially unsafe,&#xA;users will have a real opportunity to confirm it (which&#xA;Javascript-based approaches do not guarantee).  The downside is that&#xA;if the typical usage scenario involves a user having to perform the&#xA;action frequently, the confirmation round trips may become burdensome.&#xA;(On the other hand, if that&apos;s the typical scenario, we might be better&#xA;off redesigning the interface to allow for batch operations.)&#xA;&#xA;Yes, the corner case does exist.  But it&apos;s not as big as it initially&#xA;seems.&#xA;&#xA;Cheers,\\&#xA;Tom&#xA;</s:content>
        <s:mTime>2005-05-09 01:28:00.176</s:mTime>
        <s:cTime>2005-05-09 01:28:00.118</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/comment-start/2005-05-08/1-2'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#espresso'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
