<div dir="ltr">Thanks. That&#39;s a really nice way to do that. I ended up doing it with some Javascript (combining forms before submitting) but this would be less hacky.<div><br></div><div>Cheers,</div><div><br></div><div>Jeff</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Dec 5, 2015 at 7:11 PM Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jeff,<div><br></div><div>I hope I am correct with what I say, but I am not 100% sure. I think you can use Ajax for this. Since you serialize the form you won&#39;t need a HTML form tag at all. That is, no need of HTML form (unless it does not harm if you want it as for displaying/css things), and instead of using submit buttons, you use normal buttons with ajax calls and serialization. Example:</div><div><br></div><div><div><span style="white-space:pre-wrap">html button
        bePush;
        onClick: (html jQuery ajax
                                serialize: (html jQuery: &#39;.formToSubmit&#39; )
                                  script: [ :s |  
                                        self doSomething.</span></div><div><span style="white-space:pre-wrap">                               ]
        );
        value: &#39;Click me&#39;.
</span></div></div><div><br></div><div>The basis here is:</div><div><br></div><div>1) use bePush because you are using Ajax and so buttons do NOT have to be submit. </div><div>2) The magic here is #serialize: which will serialize and invoke callbacks for those inputs. And the good thing is that it accepts a jQuery as the argument of what to serialize. So you can say, for example, all those elements with css class &#39;.formToSubmit&#39;.  And then, when you render forms 1 and 3, you add css class &#39;<span style="white-space:pre-wrap">formToSubmit&#39;.  If the component is very very large, you can reduce the jquery search for performance (like checking those elements form AND css class formToSubmit etc...).</span></div><div><span style="white-space:pre-wrap">3) Note that since this is ajax, you could have a couple of headaches. For example, doing an #answer:  from within the #script:  of the ajax call is not easy. Also, if you are used to normal request, you would re-render everything automatically. Here, unless you do something inside #script:  it won&#39;t refresh anything. So depending on what you need to you may need to refresh something from there. </span></div><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">If you are used to Ajax this will be very very easy. If you need more help, let me know. </span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 4, 2015 at 2:05 PM, J.F. Rick <span dir="ltr">&lt;<a href="mailto:self@je77.com" target="_blank">self@je77.com</a>&gt;</span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I&#39;m creating a web interface using seaside that&#39;s a bit complicated. One particular annoying part is that I have to use multiple forms:</div><div>(1) Form 1 contains some fields</div><div>(2) Form 2 is used for uploading images asynchronously</div><div>(3) Form 3 contains more fields that really belong to Form 1.</div><div>Because of layout and because forms can&#39;t be within other forms, I have to have both Form 1 and 3, though really they should be the same form that uses one submit button. Is there a good way to combine the forms in such a way that the callbacks for both forms are evaluated?</div><div><br></div><div>I did notice that the _k are identical for both forms.</div><div><br></div><div>Cheers,</div><div><br></div><div>Jeff</div></div>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div></div><div class="gmail_extra"><br><br clear="all"><div><br></div>-- <br><div>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></div>
</div>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div>