2 hours ago · Tech · 0 comments

Password requirements, username rules, input format constraints: forms often have multiple validation requirements, but users frequently do not find out whether they are meeting them until they hit submit. The form-validation-list web component changes that by providing real-time visual feedback as users type, showing exactly which requirements are met and which are not.This is a modern replacement for my old jQuery Easy Validation Rules plugin, reimagined as a web component with native form validation integration.To get started, associate the component with an input element using the for attribute and define your validation rules:<form><labelfor=“username”>Username:</label><inputtype=“text”id=“username”name=“username”required/><form-validation-listfor=“username”><ul><lidata-pattern=“[A-Z]+”>At least one capital letter</li><lidata-pattern=“[a-z]+”>At least one lowercase letter</li><lidata-pattern=“[\d]+”>At least one…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.