input-validity.html (816B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Forms</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 </head> 8 <body> 9 <p> 10 <h3>input_validity</h3> 11 </p> 12 13 <hr> 14 15 <div id="log"></div> 16 17 <form method="post" 18 enctype="application/x-www-form-urlencoded" 19 action="" 20 id="input_form"> 21 <p><input type='hidden' id='input_text'></p> 22 </form> 23 <script> 24 25 var input = document.getElementById("input_text"); 26 27 if (typeof(input.validity) == "object") { 28 test(function() { 29 assert_equals(input.validity.valueMissing, false, "validity attribute is not correct."); 30 }); 31 } else { 32 test(function() { 33 assert_unreached("validity attribute is not exist."); 34 }); 35 } 36 37 </script> 38 39 </body> 40 </html>