以下是我的 JavaScript (mootools) 代码:
$('orderNowForm').addEvent('submit', function (event) {
    event.preventDefault();
    allFilled = false;
    $$(".required").each(function (inp) {
        if (inp.getValue() != '') {
            allFilled = true;
        }
    });
    if (!allFilled) {
        $$(".errormsg").setStyle('display', '');
        return;
    } else {
        $$('.defaultText').each(function (input) {
            if (input.getValue() == input.getAttribute('title')) {
                input.setAttribute('value', '');
            }
        });
    }
    this.send({
        onSuccess: function () {
            $('page_1_table').setStyle('display', 'none');
            $('page_2_table').setStyle('display', 'none');
            $('page_3_table').setStyle('display', '');
        }
    });
});
在除 IE 之外的所有浏览器中,这都可以正常工作。但在 IE 中,这会导致错误。我有 IE8,所以在使用它的 JavaScript 调试器时,我发现该event对象没有preventDefault导致错误的方法,因此正在提交表单。在 Firefox 的情况下支持该方法(我使用 Firebug 发现)。
任何帮助?