Request serializes the form, including the submit inputs. I agree w/ Steve; you'll have to disable the one you don't want serialized before you send the ajax.
On Sun, Jul 26, 2009 at 8:25 AM, Steve Onnis <[email protected]> wrote: > > You will have to do something to target each button and disable the one you > don’t want to have sent with the form. > > -----Original Message----- > From: BMo [mailto:[email protected]] > Sent: Monday, 27 July 2009 12:25 AM > To: MooTools Users > Subject: [Moo] Re: submit form with 2 submit-Buttons > > > I don't want to use id's, because the buttons on one side frequently > occur. > > > > On 26 Jul., 14:43, batman42ca <[email protected]> wrote: > > Give each submit button a unique ID and refer to that ID when adding > > the event. > > > > Try this: > > > > <input type="submit" class="back" id= "back" name="back" > > value="zuruck"> > > <input type="submit" id="weiter" name="weiter" value="weiter"> > > > > addEvent('back', function(e) { > > > > On Jul 26, 6:56 am, BMo <[email protected]> wrote: > > > > > > > > > Hi, > > > > > I have a problem when I submit this form with Mootools: > > > > > <form name="page_form_main" class="gui_window_windowform" > > > method="post" action="bla.php"> > > > <input type="submit" class="back" name="back" value="zuruck"> > > > <input type="submit" name="weiter" value="weiter"> > > > </form> > > > > > JS: > > > > > ....addEvent('submit', function(e) { > > > e.stop(); > > > this.set('send', { > > > method: 'post', > > > onComplete: function(response) { > > > $('gui_window_contentArea').empty().set('html', response); > > > } > > > }); > > > this.send(); > > > > > }); > > > > > The Problem is, that I get both submit buttons and not only the one I > > > clicked. > > > PHP echo: > > > Array ( [back] => zuruck [weiter] => weiter ); > > > > > Can you help me please! > > > > > Thx.- Zitierten Text ausblenden - > > > > - Zitierten Text anzeigen - > > >
