試圖讓程序要求最小長度爲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 –