1
00:00:00,180 --> 00:00:06,360
Hello, friend, welcome back in this video and discussion about that form validation, like if you

2
00:00:06,360 --> 00:00:11,190
want to define some of the form validation, if you want to display it, how can do that work?

3
00:00:11,190 --> 00:00:16,410
In this video, I will show you that things with a live example for doing this right now here.

4
00:00:16,410 --> 00:00:17,250
I don't need this.

5
00:00:17,670 --> 00:00:18,840
I just simply remove it.

6
00:00:19,050 --> 00:00:24,180
And now in our form, that means, you know, our APS application into the application I have created

7
00:00:24,180 --> 00:00:25,920
on the file as a form Sprite.

8
00:00:26,160 --> 00:00:30,810
So first of all, if you want to display that validation, you have to do we have to import some of

9
00:00:30,810 --> 00:00:36,270
the library that in Django they have some of the building library as a validator, so you have to use

10
00:00:36,270 --> 00:00:36,470
it.

11
00:00:36,750 --> 00:00:42,480
So first of all, I wanted to put it on here, so I just simply defined the form and that then Django

12
00:00:43,410 --> 00:00:51,240
OK, form Django the core and into the form, then got I to put it on the import of the library as a

13
00:00:51,240 --> 00:00:51,990
validators.

14
00:00:54,330 --> 00:00:59,800
OK, I just simply defined as the validators and now in particular that area that means in our class.

15
00:00:59,800 --> 00:01:06,780
So here I want to do define some of the variable as a name and then with these forms, OK, with these

16
00:01:06,780 --> 00:01:09,840
forms I want to define the type as a character.

17
00:01:09,840 --> 00:01:16,620
Felt like I just simply defined the character characterful type and the characters will die with these

18
00:01:16,620 --> 00:01:17,370
very letters.

19
00:01:17,830 --> 00:01:23,810
OK, with these very letters, I just simply defined some of the very letters from the maximum length.

20
00:01:23,810 --> 00:01:30,170
So I just simply defined as a with these validators, with this validators I want to define as one of

21
00:01:30,180 --> 00:01:32,550
the type as a max length.

22
00:01:35,350 --> 00:01:42,780
OK, invalidate, validate, OK, just to simplify the Max Lane validator, and here I define Marseillais

23
00:01:42,880 --> 00:01:48,850
maximum length will be as a 10, so they step up one of the validation I want to define in particular

24
00:01:48,850 --> 00:01:49,450
that area.

25
00:01:49,690 --> 00:01:52,010
So now we have to do we have to visibly try.

26
00:01:52,070 --> 00:01:59,680
So we have to it like in our pupate, that means in our form is will go to our farmers CMO.

27
00:02:00,280 --> 00:02:02,200
So here I have defined that field.

28
00:02:02,320 --> 00:02:06,460
So now in our view into the view here, I have defined this like that way.

29
00:02:06,460 --> 00:02:06,710
Right.

30
00:02:06,730 --> 00:02:11,370
So shall we display our D field and also I define our user form.

31
00:02:11,380 --> 00:02:11,800
Perfect.

32
00:02:12,010 --> 00:02:17,530
So now if you want to display it like I have already defined our district descend into the addition.

33
00:02:17,530 --> 00:02:22,450
I have defined the text from right into the text one with this text from I have passed it in our form

34
00:02:22,460 --> 00:02:23,010
e-mail.

35
00:02:23,020 --> 00:02:28,620
So now with this I want to do and display some of the validation message I like after this.

36
00:02:28,630 --> 00:02:32,220
OK, after this here I just simply define addiction.

37
00:02:33,700 --> 00:02:34,720
So into addiction.

38
00:02:34,720 --> 00:02:36,470
I want to update the message.

39
00:02:36,470 --> 00:02:43,340
So the simple defense update and this update area, I just simply define without this text, OK, I

40
00:02:43,360 --> 00:02:45,180
just simply defined that this text form.

41
00:02:45,760 --> 00:02:51,430
So with this text form I want to display of whatever the message I get from our post and I just take

42
00:02:51,430 --> 00:02:57,560
that things with this variable as a new our new form see in that area, I just simply defining it,

43
00:02:57,580 --> 00:03:03,520
OK, then it will be displayed our all that Airaud, which is I have defined in our post area so that

44
00:03:03,520 --> 00:03:05,140
those that are easily visible.

45
00:03:05,590 --> 00:03:07,870
So I just simply defining it in particular that area.

46
00:03:07,900 --> 00:03:15,190
So now if you click as Savol, I just came to save all and now I refresh it again.

47
00:03:17,650 --> 00:03:19,750
So maybe they have seen the error.

48
00:03:20,230 --> 00:03:26,670
Let's check this out, it's not showing as it has no attribute as a maximum validator.

49
00:03:27,040 --> 00:03:29,350
So that is actually our spelling mistake.

50
00:03:29,350 --> 00:03:35,680
Maybe again, from here you can see actually a spelling mistake there will be as a validator.

51
00:03:35,860 --> 00:03:44,350
So just simply as a validator, Valaida, it you are OK, so that will be a letter here to save all.

52
00:03:46,380 --> 00:03:51,600
Yeah, no, it's perfect, the spelling mistake friend, so now I just refresh it, yeah.

53
00:03:51,630 --> 00:03:52,980
Now consider the input form.

54
00:03:53,280 --> 00:03:58,200
So into this input form here, I have defined some of the length that with the maximum length will be

55
00:03:58,200 --> 00:03:58,920
as a 10.

56
00:03:59,070 --> 00:03:59,430
Right.

57
00:03:59,670 --> 00:04:02,810
So now I want to do under defined sound that character.

58
00:04:02,820 --> 00:04:03,870
Click on the submit.

59
00:04:04,350 --> 00:04:05,190
Yes.

60
00:04:05,190 --> 00:04:11,370
Now considering now showing some of that validation message as they Anshu, the value has at most in

61
00:04:11,370 --> 00:04:14,100
character, but it has now the 20 character.

62
00:04:14,130 --> 00:04:18,670
OK, so here if you define this one automatically, we calculated that data.

63
00:04:18,720 --> 00:04:23,100
That means here I have defined some of the validation notes perfectly displayed.

64
00:04:23,550 --> 00:04:27,270
And also here you can define some of the minimum length bellweather.

65
00:04:27,340 --> 00:04:30,670
OK, so here I want to do want to define some of the minimum.

66
00:04:31,230 --> 00:04:32,820
So here I define that maximum.

67
00:04:32,850 --> 00:04:34,770
So now I want to do and define another one.

68
00:04:35,310 --> 00:04:37,780
I just simply define another one with a validator.

69
00:04:38,730 --> 00:04:44,430
So with the very letters here, we have to define our and other types or type as a minimum.

70
00:04:45,000 --> 00:04:48,930
That means the minimum length validator.

71
00:04:51,620 --> 00:04:57,860
OK, the simplifying of the minimum plan validator seem to the minimum that I define as a five right

72
00:04:57,860 --> 00:04:59,990
now, Kleeger, to save all.

73
00:05:02,070 --> 00:05:03,580
Check out our process.

74
00:05:04,080 --> 00:05:09,360
Everything is perfect now I refresh it again, and now I define it.

75
00:05:09,360 --> 00:05:15,060
A three click on the submit now consistent showing at the end should the value at last five character

76
00:05:15,060 --> 00:05:16,750
I just put out of the three.

77
00:05:16,800 --> 00:05:20,190
OK, so for the reasons you can see, there's also you getting these validation.

78
00:05:20,440 --> 00:05:22,340
That means the minimum validation.

79
00:05:22,560 --> 00:05:28,560
And also here, if you want to display multiple Airaud at a time, you can also defining it like here

80
00:05:29,100 --> 00:05:32,250
right now I want to do I want to define another one.

81
00:05:32,250 --> 00:05:34,260
I take another variable as a number.

82
00:05:35,040 --> 00:05:37,050
OK, number under Schofield.

83
00:05:38,520 --> 00:05:40,050
OK, just name it as a number field.

84
00:05:40,380 --> 00:05:45,990
And for the number field, I define our form so our forms and then type will be at the integer field

85
00:05:45,990 --> 00:05:49,860
type desert field.

86
00:05:50,670 --> 00:05:53,660
So I just simply defined the entire field type and into the, into the field.

87
00:05:53,880 --> 00:05:55,630
I have defined the same as a validator.

88
00:05:57,900 --> 00:06:03,930
So with these very letters here, I have defined our ability to enter the validators.

89
00:06:03,930 --> 00:06:07,770
I have maximum, so I just simply want the maximum.

90
00:06:07,950 --> 00:06:13,840
So if you display your integer value, then you have to define as a value, not block, not the length.

91
00:06:13,860 --> 00:06:18,230
OK, so for the reasons here, they have another type as a maximum value, very letter.

92
00:06:18,450 --> 00:06:22,680
So just simply defending the value of a value validator.

93
00:06:25,890 --> 00:06:27,510
So here I define as a ten.

94
00:06:27,900 --> 00:06:32,760
OK, so here I define as the maximum value validator as a time.

95
00:06:32,760 --> 00:06:37,440
And also if you want to display your minimum type, then you can also defining it.

96
00:06:37,800 --> 00:06:41,760
So after this, after this, I simply define another one as a validator.

97
00:06:42,720 --> 00:06:50,580
So with these validators, I want to define our and at the time as a minimum minimum value as a validator.

98
00:06:52,380 --> 00:06:55,940
OK, and I hope you can understand about it.

99
00:06:56,160 --> 00:07:01,950
So when you actually display some of the character field and you have to define that as a maximum validator

100
00:07:02,190 --> 00:07:08,330
when you define as a Intisar field and you have to define that as a maximum value millilitre.

101
00:07:08,460 --> 00:07:14,230
OK, so that is a maximum the letter and the minimum, the minimum I define as a five.

102
00:07:14,730 --> 00:07:17,540
So now I just simply defined as a five in particular, that area.

103
00:07:17,940 --> 00:07:18,430
Perfect.

104
00:07:18,810 --> 00:07:20,970
So now I just click on to save all again.

105
00:07:23,340 --> 00:07:30,990
And now in our former steel mill, in the former steel mill, I have defined that name Soheir as a field,

106
00:07:30,990 --> 00:07:31,420
right.

107
00:07:32,010 --> 00:07:38,650
So in particular view into the view, I have defined that as a battlefield.

108
00:07:38,970 --> 00:07:40,650
So now I define our variables.

109
00:07:40,650 --> 00:07:42,960
So here I define that variable name as it.

110
00:07:43,260 --> 00:07:46,270
And this one has a number fields I just simply copied.

111
00:07:46,830 --> 00:07:53,190
Now, here are defined as the number of field and also into this general I define as the number of field

112
00:07:53,760 --> 00:07:55,380
now as to save all.

113
00:07:56,410 --> 00:07:58,030
Now, refresh it again.

114
00:07:59,670 --> 00:08:06,360
So now I define some of the validation on here and also I define the validation of the three to submit.

115
00:08:06,510 --> 00:08:12,000
Yeah, you can see not perfectly getting our two of these validation suits perfectly, getting out this

116
00:08:12,030 --> 00:08:17,380
maximum validation and also getting our maximum value validation perfect.

117
00:08:17,730 --> 00:08:20,020
And I hope you can well understand about it.

118
00:08:20,040 --> 00:08:27,480
So here you can do this work so that our form validation for the Intisar maximum value millilitre and

119
00:08:27,480 --> 00:08:29,850
for the character, it will be at the maximum.

120
00:08:29,880 --> 00:08:30,350
Glenvil.

121
00:08:30,360 --> 00:08:30,770
Ed.

122
00:08:31,050 --> 00:08:35,700
So far, the results here, you can see it's now perfectly visible on here and also here.

123
00:08:35,700 --> 00:08:40,860
If you want to define this type of validation for the input, feel like I want to create one of the

124
00:08:40,860 --> 00:08:46,620
input, feel that the email and also another one for the verification emails or whatever the things

125
00:08:46,620 --> 00:08:50,760
you put in particular, that area is match with another input field.

126
00:08:51,000 --> 00:08:55,600
OK, so here, if you want to display this type of validation, you can also do that work.

127
00:08:55,600 --> 00:09:01,880
What I will show you that is our way that these are forms right now.

128
00:09:01,900 --> 00:09:02,610
We will need this.

129
00:09:02,610 --> 00:09:03,780
I just simply remove it.

130
00:09:04,170 --> 00:09:07,440
So not only do I want to define another one, OK?

131
00:09:07,470 --> 00:09:09,120
I want to define another one for this.

132
00:09:09,120 --> 00:09:13,310
I want to do first of all, I want to take one of the variable for our input file.

133
00:09:13,320 --> 00:09:18,840
I just name it as a user, underscore email and then we have to define our forms.

134
00:09:19,830 --> 00:09:25,680
OK, I just simply defined the forms and with these forms I want to define our type or type will be

135
00:09:25,680 --> 00:09:27,180
as email field type.

136
00:09:28,080 --> 00:09:34,560
I just simply give an email field, OK, I just simplified the email field and also undertake another

137
00:09:34,560 --> 00:09:34,880
one.

138
00:09:34,890 --> 00:09:38,990
It should be a user verification email list of other reasons.

139
00:09:39,000 --> 00:09:44,040
I simply defining the v mail, this step of one of the variables I want to take.

140
00:09:44,040 --> 00:09:51,000
And with this form, like with this form, I also define that will be as the email type email field.

141
00:09:51,720 --> 00:09:54,270
So to simplify the email file type, perfect.

142
00:09:54,570 --> 00:10:02,580
And after that here I want to define one of the functions to simplify the DEVE and the clean clean.

143
00:10:02,580 --> 00:10:06,480
And here I define as a self centered the self.

144
00:10:06,480 --> 00:10:15,660
Here I want to do and define one of the variable as it all underscore clean, OK, clean data.

145
00:10:16,680 --> 00:10:20,000
And into this position I want to use of the super functions.

146
00:10:20,010 --> 00:10:24,290
If you use that super function, I just simplified super.

147
00:10:24,630 --> 00:10:29,790
So with this super function you actually get all that your data, that means all the durability data

148
00:10:29,790 --> 00:10:31,510
and take the things with this variable.

149
00:10:31,530 --> 00:10:40,350
OK, so right now I just use that super and then our function as a clean, I just simply define as a

150
00:10:40,350 --> 00:10:49,170
clean and then we have to define all that our variable as a user and then email into the C Daily Mail,

151
00:10:49,170 --> 00:10:54,080
as I told you, with the super with the super function, I get all the raw data and take the things

152
00:10:54,090 --> 00:10:55,040
with these variables.

153
00:10:55,050 --> 00:11:00,840
And now with this variable, with this variable, I want to define our filename, our filename as a

154
00:11:01,110 --> 00:11:05,610
user, underscore email that is our own field.

155
00:11:05,940 --> 00:11:11,370
And also I have another one as a user, underscore email.

156
00:11:12,000 --> 00:11:16,630
And then we are all clean data into this all clean data.

157
00:11:16,650 --> 00:11:19,530
I want to use our end of the field as a user.

158
00:11:19,740 --> 00:11:21,060
Underscore we women.

159
00:11:21,480 --> 00:11:23,070
I just simply defining it, OK?

160
00:11:23,310 --> 00:11:25,740
And now I want to do and reports on the condition here.

161
00:11:25,740 --> 00:11:33,780
I define that you if condition if our user under called email when it shall be not match one or should

162
00:11:33,780 --> 00:11:39,480
we not match with our user underscore female one it will be not match.

163
00:11:39,480 --> 00:11:44,660
Then I want to write some of the validation so I just simply fundraise ok.

164
00:11:44,700 --> 00:11:46,500
Just simply vandalise form.

165
00:11:47,370 --> 00:11:52,890
So in the form that have also that means Django form library into the Django Form Library.

166
00:11:52,890 --> 00:11:56,220
They have also done at that validation method.

167
00:11:56,220 --> 00:11:57,630
That is actually the validation error.

168
00:11:57,990 --> 00:11:58,980
I want to use it.

169
00:12:02,540 --> 00:12:03,850
Validation error.

170
00:12:05,020 --> 00:12:10,970
OK, to simplify the scenario and the validation error here, when it's really not match the source

171
00:12:10,970 --> 00:12:20,450
of the message as a field, OK, fields don't match the step of one of the methods it will be displayed.

172
00:12:20,510 --> 00:12:23,780
OK, so now we have to do we have to display it.

173
00:12:23,780 --> 00:12:26,410
So here also make sure you adding that one.

174
00:12:26,870 --> 00:12:29,900
So that is actually our condition if condition.

175
00:12:29,940 --> 00:12:36,590
And here you have to define that colon and then our eyes form and the validation that the validation

176
00:12:36,590 --> 00:12:39,240
error and the field on Matsuzawa display.

177
00:12:39,740 --> 00:12:44,380
So should we take it when this will be not match, then it should be display or this validation matter?

178
00:12:44,630 --> 00:12:45,740
That is a clear message.

179
00:12:46,190 --> 00:12:52,720
And also here we have to define that things in our you know, our view and the view here.

180
00:12:52,730 --> 00:12:53,960
I have defined that condition.

181
00:12:54,230 --> 00:12:59,780
Voynich will be not Majdanek will be display our this message and when it be met.

182
00:13:00,260 --> 00:13:03,700
OK, when it's a match then I want to pass it in our form area.

183
00:13:03,740 --> 00:13:07,070
That means in our form e-mail at base area.

184
00:13:07,070 --> 00:13:08,110
I want to pass it.

185
00:13:08,480 --> 00:13:14,210
So here if you want to pass it, that means here I don't need this right now, I just simply remove

186
00:13:14,210 --> 00:13:14,480
it.

187
00:13:14,930 --> 00:13:17,930
And in particular that position I define the text.

188
00:13:17,930 --> 00:13:19,210
So here it will be displayed.

189
00:13:19,210 --> 00:13:23,210
The field fields match the step up.

190
00:13:23,210 --> 00:13:25,490
One of the message is still the display.

191
00:13:27,050 --> 00:13:27,650
Perfect.

192
00:13:27,950 --> 00:13:29,670
So that's all you have to do.

193
00:13:30,200 --> 00:13:31,820
So now let's check this out.

194
00:13:31,820 --> 00:13:33,140
I just look at the Savol.

195
00:13:33,500 --> 00:13:37,100
Let's clear the save all go here.

196
00:13:37,310 --> 00:13:38,750
Refresh it again.

197
00:13:39,650 --> 00:13:43,190
They have soldat or better to check it again first.

198
00:13:43,730 --> 00:13:47,120
And here you can see snowshoeing is the rise form validation.

199
00:13:47,120 --> 00:13:48,850
They have unexpected spaces.

200
00:13:48,860 --> 00:13:51,260
OK, so that is very much common component of that.

201
00:13:51,260 --> 00:14:00,350
Or if you go our form that means here after the try's here sound the add or actually is getting some

202
00:14:00,350 --> 00:14:03,920
of the spaces that or so just simply defining it.

203
00:14:05,000 --> 00:14:06,110
Savol.

204
00:14:08,400 --> 00:14:10,960
Yeah, no, it's perfect, so no one to do it.

205
00:14:11,000 --> 00:14:17,490
Check it, refresh, yeah, there is he email to I'd say just simply if an arion at the original dot

206
00:14:17,490 --> 00:14:19,950
com and here I define that different.

207
00:14:19,950 --> 00:14:21,930
Another one click on the submit.

208
00:14:22,500 --> 00:14:23,570
Yes.

209
00:14:23,580 --> 00:14:24,290
Now friend.

210
00:14:24,330 --> 00:14:30,420
Now this email and our verification email is not match for the reasons it's not showing our desired

211
00:14:30,420 --> 00:14:32,160
or as if we don't match.

212
00:14:32,190 --> 00:14:35,000
So that is the condition I have defined on here.

213
00:14:35,010 --> 00:14:35,360
Right?

214
00:14:35,700 --> 00:14:40,380
When you shall be not matched with our verification email field, then it should be right.

215
00:14:40,400 --> 00:14:43,040
Some of the form validation at all and it will be displayed.

216
00:14:43,050 --> 00:14:46,810
This takes as a field or match field don't match.

217
00:14:46,830 --> 00:14:51,420
So here is no showing of the field on match and also how I define another condition.

218
00:14:51,490 --> 00:14:57,990
I define another condition in our, uh, you know, our view into the view when it will be match then

219
00:14:57,990 --> 00:15:00,320
until we display our D field match.

220
00:15:00,330 --> 00:15:00,680
Right.

221
00:15:00,720 --> 00:15:03,030
This message shall be displayed in our dictionary.

222
00:15:03,270 --> 00:15:04,610
I have already appetitive.

223
00:15:04,980 --> 00:15:06,670
I have powers that things on here.

224
00:15:07,110 --> 00:15:08,890
So now to do that, check this one.

225
00:15:08,910 --> 00:15:10,620
So now I define Azarian.

226
00:15:11,520 --> 00:15:14,970
That means now I define our appropriate email address and the password.

227
00:15:14,970 --> 00:15:15,900
Click on the submit.

228
00:15:16,560 --> 00:15:16,850
Yeah.

229
00:15:16,890 --> 00:15:22,410
Now I can see they have no arrow is not showing that the field is because of all that is actually the

230
00:15:22,410 --> 00:15:22,980
field.

231
00:15:24,060 --> 00:15:27,680
So you know, our e-mail you can see are defined as ID no field.

232
00:15:27,750 --> 00:15:32,580
So I just simply defined the field now clear to save all.

233
00:15:34,020 --> 00:15:40,020
Refresh it again Ardian and then Ardian submit.

234
00:15:40,200 --> 00:15:41,110
Yeah, perfect.

235
00:15:41,370 --> 00:15:45,990
Now this is not so easy as a field match so I hope you can well understand about it.

236
00:15:46,000 --> 00:15:49,010
So initially match the initial display, our field match.

237
00:15:49,620 --> 00:15:51,600
So that is actually our field here.

238
00:15:51,600 --> 00:15:55,380
I have defining it so here defining our field match.

239
00:15:55,380 --> 00:15:59,370
So it will be in our display and we need to be as inappropriate.

240
00:15:59,370 --> 00:16:03,280
Click on the submit then it will be for some of the validation as a field on.

241
00:16:04,080 --> 00:16:06,420
I hope you can will understand about it, Fred.

242
00:16:06,630 --> 00:16:08,100
So thanks for watching.

243
00:16:08,100 --> 00:16:09,960
I will see you in the next video.
