Form Validation with Javascript

YvonneDev
3 min readOct 14, 2020

Features:

form validation with html validation format

phone number and email address with Reg expression

passwords should be match with Javascript function to go through register processing

show up the message below according to the filling content

CODE Github

DEMO

HTML

all the inputs are required. If empty, register won’t pass.

the pattern of the phone is a reg expression with a 10 number format.

the password pattern is from RegExr

the message display box changing with Javascript. default is “here”

CSS

center the form container

--

--

YvonneDev

❤️Front-end Web Development self-taught *share what I learned*