40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="../../../resources/js-test-pre.js"></script>
|
|
</head>
|
|
<body>
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
<form id=f action="interactive-validation-required-radio.html">
|
|
<input type=hidden name=submitted value="true">
|
|
<input type=radio name=terms id=i0>
|
|
<input type=radio name=terms id=i1 required>
|
|
<input type=submit id="s">
|
|
</form>
|
|
<script>
|
|
description('There was a bug of validation of a required radio button. This test confirms the bug has been fixed.');
|
|
|
|
function startOrVerify() {
|
|
var query = window.location.search;
|
|
if (query.indexOf('submitted=true') != -1) {
|
|
testPassed('The form should be submitted.');
|
|
shouldBeTrue('location.search.indexOf("terms=on") != -1');
|
|
debug('TEST COMPLETE');
|
|
if (window.testRunner)
|
|
testRunner.notifyDone();
|
|
} else {
|
|
document.getElementById('i1').checked = true;
|
|
// HTMLFormElement::submit() skips validation. Use the submit button.
|
|
document.getElementById('s').click();
|
|
testFailed('The form was not submitted.');
|
|
}
|
|
}
|
|
|
|
if (window.testRunner)
|
|
testRunner.waitUntilDone();
|
|
window.onload = startOrVerify;
|
|
</script>
|
|
</body>
|
|
</html>
|