/**
* novalidate should prevent form validation, thus not blocking form submission.
*
* NOTE: if the MozInvalidForm event doesn't get prevented default, the form
* submission will never be blocked and this test might be a false-positive but
* that should not be a problem. We will remove the check for MozInvalidForm
* event, see bug 587671.
*/
document.forms[0].addEventListener("submit", function(aEvent) {
ok(true, "novalidate has been correctly used for first form");
document.getElementById('b').click();
}, {once: true});
document.forms[1].addEventListener("submit", function(aEvent) {
ok(true, "novalidate has been correctly used for second form"); var c = document.getElementById('c');
c.focus();
synthesizeKey("KEY_Enter");
}, {once: true});
document.forms[2].addEventListener("submit", function(aEvent) {
ok(true, "novalidate has been correctly used for third form");
SimpleTest.executeSoon(SimpleTest.finish);
}, {once: true});
/**
* We have to be sure invalid events are not send too.
* They should be sent before the submit event so we can just create a test
* failure if we got one. All of them should be catched if sent.
* At worst, we got random green which isn't harmful.
*/
function invalidHandling(aEvent)
{
aEvent.target.removeEventListener("invalid", invalidHandling);
ok(false, "invalid event should not be sent");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.