html - Why does my Foundation Abide pattern not work? -
i have following html making sure password length on 8 characters:
<label>password <small>required</small> <input type="password" name="password" id="password" required pattern=".{8,}"> </label> <small class="error">your password must @ least 8 characters long.</small>
this works. however, if in different field use pattern [a-za-z]+
, this:
<label>username <small>required</small> <input type="text" name="username" required pattern="[a-za-z0-9]+"> </label> <small class="error">username must consist out of letters or numbers only.</small>
it allow everything. if change pattern in username field .{8,}
, allow inputs on 8 characters in length, expected. why pattern username field not work?
the documentation states correct way it:
<label>your name <small>required</small> <input type="text" required pattern="[a-za-z]+"> </label> <small class="error">name required , must string.</small>
the fix wrap pattern in line begin , end characters, such:
<input type="text" name="username" required pattern="^[a-za-z0-9]+$">
maybe bug in foundation needs reported on github?
Comments
Post a Comment