I went ahead and moved the setup into your XHRify method. Since the only
thing that could be variable at submit time is the action and the data, that
is passed as options to the Form.send method.

http://jsfiddle.net/seanmonstar/nSpBg/1/



On Sat, Nov 27, 2010 at 3:35 PM, Sean McArthur <[email protected]>wrote:

> That's because in the function that fires on submit, you're setting the
> onComplete and onRequest options each time. Those functions get added to the
> Request's event list. You should only do the setup of your requests once.
> (This is good practice for all programming tasks, make sure your setup only
> happens once).
>
>
>
> On Sat, Nov 27, 2010 at 3:28 PM, Dailce <[email protected]> wrote:
>
>> Your code is working, but there is strange behavior.
>>
>> The "alert" happens once on first click, if I click it again then the
>> "alert" is fired twice, click again and it's fired 3 times, etc...
>>
>> So now I'm not sure what's happening.
>
>
>

Reply via email to