1) use domready (http://mootools.net/docs/Utilities/DomReady)
2) don't attach your method like this:

someform.addEvent('submit', AJAXformSubmit(e));

as you are invoking your method (with the '(e)')

but instead like:

someform.addEvent('submit', AJAXformSubmit);

On Tue, Dec 30, 2008 at 8:28 AM, thijsvogels (via Nabble) <
[email protected]<ml-user%[email protected]>
> wrote:

> Hi,
>
> To create a form that submits with AJAX, I use this function:
>
> function AJAXformSubmit(e) {
>         e.stop();
>         var log = $('content');
>         this.set('send', {onComplete: function(response) {
>                         log.set('html', response);
>         }});
>         this.send();
> });
>
> I'm trying to attach this:
> someform.addEvent('submit', AJAXformSubmit(e));
> to a form that's in a piece of code that was requested earlier.
>
> How can I attach it to the form? How do I know when the object is ready
> (like domloaded)?
>
>
> Thanks,
>
> Thijs
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/domready-after-ajax-request-tp2092919p2092919.html
> To start a new topic under MooTools Users, email
> [email protected]<ml-node%[email protected]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>


-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
Clientcide:  http://www.clientcide.com www.clientcide.com 
-- 
View this message in context: 
http://n2.nabble.com/domready-after-ajax-request-tp2092919p2092972.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to