试图让程序要求最小长度为8,最大长度为30但它不起作用,有人可以让我朝着正确的方向请谢谢! (9号线)使用模式属性HTML不检查长度的代码
<?php ob_start(); ?>
<html>
<head>
<title>Teacher Registeration</title>
</head>
<body>
<form method='POST' action='TeacherRegisterCheck.php'>
Email:<input type="email" id= "Email" name="teacherEmail" required /><br><br>
Password:<input type="password" pattern=".{8,30}" id= "Password" name="teacherPassword" required title=" 8 to 30 characters" /><br><br>
First Name:<input type="text" id= "First_Name" name="teacherfName" required /><br><br>
Last Name:<input type="text" id= "Last_Name" name="teacherlName" required /><br><br>
<label for="Title"> Title: </label> <select name="Title">
<option selected="" value= "Default"> (Select A Title) </option>
<option value= "Mr">Mr.</option>
<option value= "Mrs">Mrs.</option>
<option value= "Miss">Miss.</option>
<option value= "Ms">Ms.</option>
<option value= "Dr">Dr.</option>
<option value= "Master">Master.</option> </select> </br></br>
<button type="submit"> Enter </button>
</form>
</body>
</html>
<?php
什么是你看到的行为?你使用什么浏览器和版本? – hoffm
适用于FireFox 57.可能是浏览器特定的。 http://jsbin.com/pupuxoqome/edit?html,console,output – bassxzero
它不检查只是去下一个PHP文件,我使用谷歌浏览器61.0.3163.100 –