简体   繁体   中英

Update div after form send Mootools 1.1 to Mootools 1.2

I have this Mootools 1.1 script that is updating div after the form is submited ,

tried to convert it to mootools 1.2.4 but the log does not work and I am not getting any errors either

Mootools 1.1

        $('myform').addEvent('submit', function(e) {

            new Event(e).stop();
            var log = $('log_res').empty().addClass('ajax-loading');
            this.send({
                update: log,
                onComplete: function() {
                    log.removeClass('ajax-loading');

                }
            });
        }); 

mootols 1.2

        $('myform').addEvent('submit', function(e) {

            new Event(e).stop();
            var log = $('log_res').empty().addClass('ajax-loading');
            this.set('send',{
                update: log,
                onComplete: function() {
                    log.removeClass('ajax-loading');

                }
            }).send();
        }); 

try this:

     $('myform').addEvent('submit', function(e) {

        e.stop();
        var log = $('log_res').empty().addClass('ajax-loading');
        this.set('send',{
            url: this.get("action"),
            data: this,
            update: log,
            onComplete: function() {
                log.removeClass('ajax-loading');

            }
        }).send();
    }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM