Thanks guys!

i already tried this solution..
the problem is my action-attribute it has different domain..
it's possible, that cross-domain and form.submit don't work together?

here the code-version with preventDefault and form.submit:

window.addEvent('domready', function() {
        $('send-button').addEvent('click',function(event) {
            event.preventDefault();
            var myRequest = new Request({
                 url: '/ajax-target.html',
                 onSuccess: function() {
                        alert('done');  // works!
                        $('myform').send();  // FAIL!!! Default submit
fails..
                 }
            }).send();
        }
    });
});


On 3 Sep., 10:07, Rolf -nl <[email protected]> wrote:
> Yes, I would submit the form in the onSuccess callback from your ajax-
> request. That way you can even decide not to do the submit at all if
> your request fails (which might be important enough not to go to post
> paypal). So, stop the default event with event.stop()
> or .preventDefault(), then do your request and onSuccess do the
> form.submit to paypal.
>
> On Sep 3, 9:15 am, Sanford Whiteman <[email protected]>
> wrote:
>
> > > I need to setup an ajax-request before default form submition.. it's
> > > possible?
>
> > Either  the  Request  has  to  be  set  to synchronous, or you have to
> > manually  call  submit() in the callback. An async Request cannot beat
> > out the default action.
>
> > -- Sandy

Reply via email to