Adding Restrictions to a Password in HTML?

html, passwords

Solution

Use an input pattern. Note that this is specific to HTML5.

<form>
<input type="password" name="pass" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="at least one number and one uppercase and lowercase letter, and at least 8 or more characters" required />
<input type="submit" />
</form>

See: http://www.codingcage.com/2015/03/html5-form-validations-with-pattern.html

Problem

I'm making a form that has the user enter a username and password. Is there any way to add restrictions to a password, only using HTML? (NOT looking to use Javascript, PHP, etc.) I want it to "force" the user to have to input at least 1 uppercase, 1 lowercase letter, etc. I don't know if it matters, but here's what I have so far: ``` <b>Password:</b> <input type="password" "size=20" name="pswd" min="7" max="15"> ```

Original source