1
00:00:00,060 --> 00:00:00,720
Welcome back.

2
00:00:00,750 --> 00:00:05,970
Great job on making it this far into the course, we've been building out a form with validation.

3
00:00:06,010 --> 00:00:07,860
So now let's test our form.

4
00:00:07,990 --> 00:00:09,620
So do a quick refresh.

5
00:00:09,630 --> 00:00:15,570
If we do sign up, we see invalid email, we see the password needs between three and four characters

6
00:00:15,690 --> 00:00:18,300
and username is a required field.

7
00:00:18,570 --> 00:00:23,830
So let's put in a value into username and that one disappears.

8
00:00:23,830 --> 00:00:27,340
So that one is OK if we put in a value into email.

9
00:00:27,390 --> 00:00:29,280
This is not a valid email address.

10
00:00:29,330 --> 00:00:33,630
We've got to make sure that we do have a valid email address before it will let us proceed within the

11
00:00:33,630 --> 00:00:34,080
form.

12
00:00:34,140 --> 00:00:35,970
And then lastly, we need a password.

13
00:00:36,120 --> 00:00:41,100
The password needs to be characters without any kind of odd characters.

14
00:00:41,100 --> 00:00:45,740
So we need to make sure that the password and we're throwing that last error.

15
00:00:45,750 --> 00:00:52,710
So the password only numbers and letters and we see that it has to be between three and eight characters.

16
00:00:52,860 --> 00:00:56,280
And actually there's a little bit of a bug there because we entered in eight.

17
00:00:56,280 --> 00:00:59,570
And that means that we need to make this minor adjustment here.

18
00:01:00,030 --> 00:01:03,570
So that will now be between three and eight characters.

19
00:01:03,870 --> 00:01:07,730
So we've got everything right on the form, but it's still not submitting.

20
00:01:07,740 --> 00:01:12,620
And this is where we can submit the form where we've got everything in place.

21
00:01:12,630 --> 00:01:14,610
We've got all of the validation ready.

22
00:01:14,610 --> 00:01:17,580
So we're going through we're checking to see all of the validation.

23
00:01:17,760 --> 00:01:19,560
We've gone through all of the inputs.

24
00:01:19,710 --> 00:01:25,850
And at this point, if the validation is good, then we are able to submit our form.

25
00:01:25,980 --> 00:01:31,350
So let's add in that last condition where we're checking to see if there's no errors.

26
00:01:31,770 --> 00:01:40,770
And if error is true, then we can take my form and apply submit function to it.

27
00:01:40,890 --> 00:01:48,030
Just that will submit the form using JavaScript and just making sure that we've got our error within

28
00:01:48,030 --> 00:01:48,570
the parent.

29
00:01:48,810 --> 00:01:50,190
So everything looks pretty good.

30
00:01:50,200 --> 00:01:52,530
So I think we are ready to try that now.

31
00:01:52,740 --> 00:01:58,980
And let's make sure that we enter in a valid email address, a valid password and a valid username.

32
00:01:58,980 --> 00:02:02,460
We do sign up and we are able to submit our form.

33
00:02:02,760 --> 00:02:05,460
So next to that we can do is we can change the type.

34
00:02:05,460 --> 00:02:07,260
So changing this to password.

35
00:02:07,530 --> 00:02:12,390
So that's typically done for passwords so that that gives you those dots, those asterisks.

36
00:02:12,630 --> 00:02:14,730
So that's still going to all work the same way.

37
00:02:14,970 --> 00:02:21,300
So even though you can't see what I'm typing in, you can see that it's throwing the error message and

38
00:02:21,390 --> 00:02:22,320
work in the same way.

39
00:02:22,500 --> 00:02:28,000
So usually when I am testing, I just make sure that I do see the content going in.

40
00:02:28,010 --> 00:02:32,770
So in case I want to do any debugging or error checking, it makes a little bit easier.

41
00:02:33,210 --> 00:02:37,470
So go ahead and add in that final piece to your application.

42
00:02:37,480 --> 00:02:42,120
So submitting the form dynamically with JavaScript, if you have an Ajax submission, you could do that

43
00:02:42,120 --> 00:02:46,290
at this point as well and you're ready to complete the application.

44
00:02:46,290 --> 00:02:49,710
You can also tweak can adjust some of these parameters that we're looking for.

45
00:02:49,860 --> 00:02:52,050
And coming up next, we'll do a final code review.
