【发布时间】:2016-07-26 22:29:28
【问题描述】:
我想在第二个密码框下有一个要求标题,但“标题”似乎对我不起作用..
<form action="register.php" method="post">
<p>
First Name:
<input type="text" name="first_name" size="15" maxlength="20" required pattern="[a-zA-Z]+" required oninvalid="this.setCustomValidity(this.willValidate?'':'Please enter first name')"></input>
</p>
<p>
Last Name:
<input type="text" name="last_name" size="15" maxlength="40" required pattern="[a-zA-Z]+" oninvalid="this.setCustomValidity(this.willValidate?'':'Please enter last name')"></input>>
</p>
<p>
Email Address:
<input type="email" name="email" size="20" maxlength="60" required oninvalid="this.setCustomValidity(this.willValidate?'':'Please enter a vaild email')"></input>
</p>
<p>
Password:
<input type="password" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" name="pass1" onchange="form.pass2.pattern = this.value;" size="10" maxlength="20" required oninvalid="this.setCustomValidity('Please Enter a valid password')"></input>
</p>
<p>
Confirm Password:
<input type="password" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" name="pass2" size="10" maxlength="20" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters">
</p>
<p>
<input type="submit" name="submit" value="Register" />
</p>
</form>
【问题讨论】:
-
嗯,该编辑仍然没有将该文本添加到页面..
-
您的标记无效,
<input>是自动关闭的,不需要关闭标记。删除</input>
标签: html forms validation