JSFiddle - React, Tailwind, and code Playground
by idiotsden
HTML
<form id="regForm" method="post">
UserName:
<input id="uname" type="text" required pattern="[a-zA-Z0-9]{4,}" maxlength="15" title="UserName is too short. Enter at least 4 characters"/>
<br/><br/>
Password:
<input id="uname" type="password" required pattern="[a-zA-Z0-9]{3,}" maxlength="20" title="Password is too short"/>
<br/><br/>
<input type="submit"/>
</form>