Di seguito è riportato il mio codice 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', '');
}
});
});
In tutti i browser tranne IE, questo funziona bene. Ma in IE, questo provoca un errore. Ho IE8 quindi mentre usando il suo debugger JavaScript, ho scoperto che l' eventoggetto non ha un preventDefaultmetodo che causa l'errore e quindi il modulo viene inviato. Il metodo è supportato in caso di Firefox (che ho scoperto usando Firebug).
Qualsiasi aiuto?