English subtitles

← User Signup - Web Development

Get Embed Code
4 Languages

Showing Revision 10 created 05/25/2016 by Udacity Robot.

  1. For your next homework what I'd like you to do is make a signup page
  2. that validates a user's input.
  3. It should ask for 4 things--a name, a password, verify the password, and an email address,
  4. which will be optional.
  5. If the user submits something that's invalid, it should print out an error message,
  6. and if it is valid, it should redirect to a welcome page.
  7. I'll give you a demo of this now.
  8. Here's my signup page. It's running at this URL.
  9. If I were to type in a valid username and passwords and an email
  10. and click submit, watch the URL.
  11. We get redirected to Welcome--username equals spez--
  12. where it prints out Welcome, spez!
  13. Now a couple things that this should do.
  14. If you don't enter a username and you submit, we should get an error message.
  15. Likewise, if we don't enter a password, you should get an error message.
  16. If we submit an invalid username--this one's invalid because it has a space in it,
  17. and I'll include in the notes what a valid username is--
  18. we should still get an error message.
  19. If I include 2 passwords that do not match, I'll also get an error message.
  20. Now notice that when we included an invalid username, we kept the username in the form,
  21. but when we included an invalid password, we blanked the passwords.
  22. That is intentional.
  23. The email address is optional.
  24. I can type in 2 matching passwords. I can make this a valid username.
  25. When I submit this form, it says Welcome.
  26. Okay, all is well.
  27. If I type in an invalid email address, and I'll include for you what makes an email address
  28. valid for our purposes, we should get an error message on that field as well.
  29. That's not a valid email.
  30. Be sure to read the notes, and when you've got this all working,
  31. please enter the URL here. Good luck!