All language subtitles for 008 Validating Numbers_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French Download
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,300 --> 00:00:06,480 In this lecture, we're going to continue validating the fields in the form the next field in the form 2 00:00:06,480 --> 00:00:07,620 is the age. 3 00:00:07,830 --> 00:00:10,090 A lot of this will be similar to before. 4 00:00:10,140 --> 00:00:11,660 So let's jump right into it. 5 00:00:11,970 --> 00:00:18,600 We'll be working in the authentication component file in this component search for the age, input in 6 00:00:18,600 --> 00:00:19,230 the template. 7 00:00:21,750 --> 00:00:27,150 It's below the field for the email will change the input element to the field component. 8 00:00:29,590 --> 00:00:36,370 One thing you'll notice is that we have the type attribute set to no, the type attribute for the email 9 00:00:36,370 --> 00:00:42,380 is also being set validate will modify the type of the input element it generates. 10 00:00:42,700 --> 00:00:47,080 This is why we don't have to remove or do anything else to get the desired type. 11 00:00:47,470 --> 00:00:51,220 The attributes are passed onto the element the component generates. 12 00:00:51,730 --> 00:00:56,980 The next thing we'll do is set the name of the field by setting the name attribute to age. 13 00:00:59,430 --> 00:01:04,709 Keep in mind, the names we're using on our fields should correspond to the names we're using in the 14 00:01:04,739 --> 00:01:05,970 validation schema. 15 00:01:06,330 --> 00:01:09,850 This is how Validate will know where to enforce the rules. 16 00:01:10,170 --> 00:01:15,360 Speaking of the validation schema, let's scroll down to the object to add some rules. 17 00:01:17,850 --> 00:01:24,210 In some instances, you may want to have a minimum age requirement, the minimum rule will not work 18 00:01:24,210 --> 00:01:25,200 in this scenario. 19 00:01:25,500 --> 00:01:28,650 It'll consider non numeric characters to be valid. 20 00:01:28,980 --> 00:01:31,500 We want the rule to validate numeric values. 21 00:01:31,500 --> 00:01:35,100 Only any non numeric character should throw an error. 22 00:01:35,380 --> 00:01:38,840 There's an alternative rule available called minimum value. 23 00:01:39,240 --> 00:01:43,710 It'll check if the input is numeric and doesn't fall below a specific number. 24 00:01:44,380 --> 00:01:46,500 We'll need to import and register it. 25 00:01:46,650 --> 00:01:48,480 Open the validation file. 26 00:01:50,950 --> 00:01:57,520 In the import statement for the rules, import the minimum value rule object, we're going to assign 27 00:01:57,520 --> 00:02:00,010 it an alias called minimum value. 28 00:02:02,580 --> 00:02:09,150 This alias is to prevent Lynch from throwing an error because the minimum value rule uses underscores 29 00:02:09,509 --> 00:02:12,090 underscores for important teams were not allowed. 30 00:02:12,450 --> 00:02:18,780 While we're here, we're going to import another rule called maximum value with an alias of maximum 31 00:02:18,780 --> 00:02:19,320 value. 32 00:02:21,840 --> 00:02:27,180 We'll want to make sure no one is registering with the ridiculous age like three hundred, adding a 33 00:02:27,180 --> 00:02:30,660 rule for checking for a maximum value will help us with that. 34 00:02:30,960 --> 00:02:37,020 Let's register the rules called the define rule function twice for both rules we imported. 35 00:02:37,350 --> 00:02:42,090 We're going to keep the underscore characters and their names intact for consistency. 36 00:02:48,720 --> 00:02:54,300 We don't need to import any more rules, these will suffice for the age, if you would like to add more 37 00:02:54,300 --> 00:02:59,010 rules, then go ahead, switch back to the authentication component file. 38 00:02:59,280 --> 00:03:05,340 We'll add the following rules to the field required minimum value, maximum value. 39 00:03:10,100 --> 00:03:16,970 The minimum and maximum rules allow us to set the thresholds for the minimum value rule will set it 40 00:03:16,970 --> 00:03:17,740 to 18. 41 00:03:18,050 --> 00:03:20,780 We want users who are 18 years or older. 42 00:03:21,050 --> 00:03:24,330 The maximum value rule will be set to one hundred. 43 00:03:24,620 --> 00:03:26,870 Some people are over 100 years old. 44 00:03:27,080 --> 00:03:28,400 This is just an example. 45 00:03:28,550 --> 00:03:29,860 Feel free to bump it up. 46 00:03:30,410 --> 00:03:32,570 Let's move on to handling the error. 47 00:03:32,810 --> 00:03:34,970 Scroll back up to the AIDS field. 48 00:03:35,240 --> 00:03:38,090 We'll copy the markup we used for the other errors. 49 00:03:38,390 --> 00:03:44,780 We'll copy the error message component from the email field and paste it below the age input field. 50 00:03:47,010 --> 00:03:50,850 We'll need to update the expression to output the error for the age. 51 00:03:53,250 --> 00:03:58,950 At this point, we're repeating the same thing, however, it does give us the opportunity to explore 52 00:03:58,950 --> 00:03:59,840 different rules. 53 00:04:00,090 --> 00:04:03,270 Let's verify that the age field is being validated. 54 00:04:03,510 --> 00:04:04,980 Switch over to the Rouzer. 55 00:04:07,400 --> 00:04:11,300 All attempts to break the rule for non numeric characters. 56 00:04:13,600 --> 00:04:15,010 We will receive an error. 57 00:04:15,160 --> 00:04:20,709 Next will test the rules for when a value is outside the bounds of the range we set. 58 00:04:23,180 --> 00:04:29,630 Another error, great, the age validation is working like we wanted in the next lecture, we'll work 59 00:04:29,630 --> 00:04:31,280 on the password fields. 5829

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.