I just updated the Ajax example to use Prototype 1.6.0.2 (latest). Version 1.6 offers a new option to Form.serialize() that allows you to specify which submit button to include in the query string. If you don't specify one, it uses the first one in the form, just like a browser does. What I did to fix the calculator example is change the stripes:button elements to stripes:submit and change the form submission function to call Form.serialize(form, {submit:event}) to specify which event should fire. Check out the latest code from SVN and take a look.

A couple of notes about this. Prototype *always* includes enabled buttons in the query string, as do browsers. You have to change your buttons to submits to make this work. By changing buttons to submits, you will cause the form to try to submit normally. I added a line of code to disable that behavior.

-Ben

Ben Gunter wrote:
I think we've dealt with this problem for too long. I've logged a JIRA issue (http://www.stripesframework.org/jira/browse/STS-568) where I propose a simple fix in Stripes itself. Comments welcome.

-Ben

Lionel wrote:
Ken wrote:
hello all,
I am having the problem with the ajax submission from a page with
both a stripes:button and stripes:submit on the same page and it
always go to the default.  Ive read whats on the web and the mailing
list am I am wondering if there is a definite solution to this
problem and if so what version of stripes and/or prototype it was
implemented in or the easiest way I can solve it. Thanks in advance.
Ken
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to