Take a look first line in the invoke function:

   function invoke(form, event, container) {
     if (!form.onsubmit) { form.onsubmit = function() { return false } };
     var params = Form.serialize(form, {submit:event});
     new Ajax.Updater(container, form.action, {method:'post',
   parameters:params});
   }

That line effectively disables the normal form submit function. If a form's onsubmit returns false, then the form will not submit. When you click the normal submit button first, the form has no onsubmit and so it happily does its thing. The first time you click that AJAX submit button, though, it creates an onsubmit that returns false.

What you have to do is ensure that the form's onsubmit is null (or returns true) when the normal submit button is clicked. One way would be to add onclick="this.form.onsubmit=null" to your normal submit button.

-Ben

Ken Barnes wrote:
if i refresh the page and hit the non-ajax button it will submit as many times but if i hit the ajax button then try the non-ajax button it wont send the request.
-------------------------------------------------------------------------
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