fac19 / Week8-BFOP

https://snippetsofcode.herokuapp.com/
0 stars 2 forks source link

Reimplementing form validation #41

Closed oliverjam closed 4 years ago

oliverjam commented 4 years ago

You've written quite a bit of code to implement your own form validation for sign up. This isn't necessarily bad, and it's a good learning exercise, but I wanted to point out that it might be easier to let the browser handle as much of it as possible.

For example the browser will keep track of invalid inputs automatically, so you don't need your own valid object. Since you're using a type="email" input the browser could tell you if the email is invalid and you could drop the giant regexp etc.

Maybe have a look back at the validation workshop.

You also have some buggy behaviour with your one: the password info disappears as soon as I start typing, and there's no indication that the input is invalid when I try to submit. It just doesn't do anything.

VatsKan commented 4 years ago

also password doesn't have a label on sign up form (a little confusing what is supposed to go in the make it memorable placeholder)

Chloeh24 commented 4 years ago

There are a bunch of error messages in your sign-up.js for each form item but these never appear

You have a message div in your html though so could select that and change the text.content in there

Joepock123 commented 4 years ago

Ye just to add had a really confusing time trying to sign up. Didn't see the error messages but looking at the username we are meant to use an odd number of characters?