use pattern and validitystate instead of maxlength

This commit is contained in:
Grant Bacon 2025-11-22 10:53:08 -08:00
parent 90b084395d
commit ae3b844300
No known key found for this signature in database
GPG key ID: 1C73EA83060D6644

View file

@ -111,7 +111,7 @@
<div>
<form id="lf" method="post" enctype="multipart/form-data" action="{{ r }}/{{ qvpath }}">
<input type="hidden" id="la" name="act" value="login" />
<input type="password" id="lp" name="cppwd" placeholder=" password" maxlength="64" />
<input type="password" id="lp" name="cppwd" placeholder=" password" oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Password must be between 1 and 64 characters')" "pattern="^.{1,64}$" />
<input type="hidden" name="uhash" id="uhash" value="x" />
<input type="submit" id="ls" value="Unlock" />
{%- if ahttps %}
@ -137,9 +137,9 @@
<input type="hidden" id="la" name="act" value="login" />
{%- if this.args.usernames %}
<input type="text" id="lu" name="uname" placeholder=" username" size="12" />
<input type="password" id="lp" name="cppwd" placeholder=" password" size="12" maxlength="64" />
<input type="password" id="lp" name="cppwd" placeholder=" password" size="12" oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Password must be between 1 and 64 characters')" pattern="^.{1,64}$" />
{%- else %}
<input type="password" id="lp" name="cppwd" placeholder=" password" maxlength="64" />
<input type="password" id="lp" name="cppwd" placeholder=" password" oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Password must be between 1 and 64 characters')" pattern="^.{1,64}$" />
{%- endif %}
<input type="hidden" name="uhash" id="uhash" value="x" />
<input type="submit" id="ls" value="login" />