Validation

5 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€85.57
List Price:  €119.80
You save:  €34.23
£74.30
List Price:  £104.03
You save:  £29.72
CA$136.88
List Price:  CA$191.64
You save:  CA$54.76
A$152.30
List Price:  A$213.22
You save:  A$60.92
S$128.07
List Price:  S$179.31
You save:  S$51.23
HK$784.91
List Price:  HK$1,098.91
You save:  HK$313.99
CHF 79.58
List Price:  CHF 111.42
You save:  CHF 31.83
NOK kr1,015.81
List Price:  NOK kr1,422.17
You save:  NOK kr406.36
DKK kr638.64
List Price:  DKK kr894.12
You save:  DKK kr255.48
NZ$166.72
List Price:  NZ$233.42
You save:  NZ$66.69
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳12,122.93
List Price:  ৳16,972.59
You save:  ৳4,849.65
₹8,580.96
List Price:  ₹12,013.68
You save:  ₹3,432.72
RM424.15
List Price:  RM593.83
You save:  RM169.68
₦153,309.66
List Price:  ₦214,639.66
You save:  ₦61,330
₨28,516.05
List Price:  ₨39,923.61
You save:  ₨11,407.56
฿3,240.62
List Price:  ฿4,537
You save:  ฿1,296.38
₺4,021.62
List Price:  ₺5,630.43
You save:  ₺1,608.81
B$559.32
List Price:  B$783.07
You save:  B$223.75
R1,779.75
List Price:  R2,491.73
You save:  R711.97
Лв167.31
List Price:  Лв234.24
You save:  Лв66.93
₩137,793.10
List Price:  ₩192,915.85
You save:  ₩55,122.75
₪334.67
List Price:  ₪468.56
You save:  ₪133.88
₱5,670.73
List Price:  ₱7,939.25
You save:  ₱2,268.51
¥14,769.05
List Price:  ¥20,677.27
You save:  ¥5,908.21
MX$1,868.58
List Price:  MX$2,616.09
You save:  MX$747.50
QR365.25
List Price:  QR511.37
You save:  QR146.11
P1,336.77
List Price:  P1,871.53
You save:  P534.76
KSh12,918.70
List Price:  KSh18,086.70
You save:  KSh5,168
E£4,939.38
List Price:  E£6,915.33
You save:  E£1,975.95
ብር13,717.88
List Price:  ብር19,205.59
You save:  ብር5,487.70
Kz91,186.38
List Price:  Kz127,664.58
You save:  Kz36,478.20
CLP$96,838.31
List Price:  CLP$135,577.51
You save:  CLP$38,739.20
CN¥717.22
List Price:  CN¥1,004.14
You save:  CN¥286.92
RD$6,036.19
List Price:  RD$8,450.91
You save:  RD$2,414.71
DA12,982.86
List Price:  DA18,176.52
You save:  DA5,193.66
FJ$224.49
List Price:  FJ$314.30
You save:  FJ$89.80
Q769.65
List Price:  Q1,077.54
You save:  Q307.89
GY$20,952.77
List Price:  GY$29,334.72
You save:  GY$8,381.94
ISK kr12,184.78
List Price:  ISK kr17,059.18
You save:  ISK kr4,874.40
DH901.47
List Price:  DH1,262.10
You save:  DH360.62
L1,689.88
List Price:  L2,365.90
You save:  L676.02
ден5,273.74
List Price:  ден7,383.45
You save:  ден2,109.70
MOP$810.08
List Price:  MOP$1,134.14
You save:  MOP$324.06
N$1,789.62
List Price:  N$2,505.55
You save:  N$715.92
C$3,687.16
List Price:  C$5,162.18
You save:  C$1,475.01
रु13,772.90
List Price:  रु19,282.62
You save:  रु5,509.71
S/356.12
List Price:  S/498.58
You save:  S/142.46
K414.38
List Price:  K580.15
You save:  K165.76
SAR375
List Price:  SAR525.01
You save:  SAR150.01
ZK2,324.35
List Price:  ZK3,254.18
You save:  ZK929.83
L434.64
List Price:  L608.52
You save:  L173.87
Kč2,110.58
List Price:  Kč2,954.90
You save:  Kč844.32
Ft34,242.39
List Price:  Ft47,940.72
You save:  Ft13,698.32
SEK kr962.40
List Price:  SEK kr1,347.41
You save:  SEK kr385
ARS$127,887.21
List Price:  ARS$179,047.22
You save:  ARS$51,160
Bs694.77
List Price:  Bs972.70
You save:  Bs277.93
COP$400,638.60
List Price:  COP$560,910.07
You save:  COP$160,271.47
₡50,570.05
List Price:  ₡70,800.09
You save:  ₡20,230.04
L2,630.92
List Price:  L3,683.40
You save:  L1,052.47
₲776,155.59
List Price:  ₲1,086,648.87
You save:  ₲310,493.28
$U4,075.18
List Price:  $U5,705.41
You save:  $U1,630.23
zł363.94
List Price:  zł509.53
You save:  zł145.59
Already have an account? Log In

Transcript

Hello, in this video we are going to take a look at vanie datian. So just some basic form validation. So let's go to HTML. Let's create a form for starters. And in here will What should we have an input in here? I'm actually just gonna keep it simple one input.

You understand what we do we just want you to be able to type equals txt name to eat as well. The name you guys. We were messy. Oh yeah, so we got this little input right here. That's pretty darn cool one do we can get I'm putting in now. I'm actually gonna put I'm gonna go radical.

I'll have a deal with your activity. Also. Click me, click me. Click me. And I'm gonna have an ID wacky. I'm just gonna say on click on lick, lick in onClick we'll put that in.

Just put that. Keep it simple. It's a function as usual, to console log, make sure it is working. When we click it, Libya's broken. Okay. Now here, what we're going to do is we are going to say document dot docx and from here we are going to essentially access elements and we can literally do dot name.

User Name. User name dot value printing console log console dot log. Oh hello, checkmate cannot read value of undefined. Okay. username is not valid Okay, okay. Okay, so for the form I need to provide a name as well.

And foremost, they're almost they say, document dot get the epic form, then you get an element from it. Okay, say hello. We get Hello. So that's how you get it. And what we're going to do is we'll keep this printout in there honestly doesn't really matter. And I think what we'll do is create a variable for var one equals this and everything everywhere that we need it, we can just use this instead, it'd be a lot easier to here we'll have it in here.

And we'll check if it's empty. Then we'll say you know, you've been very naughty. So if it's, you know, nothing in it. Then we're gonna say console dot log. Isn't it if I put something in week we don't get that. We'll also do a nova checks the wrong one, and we want a minimum length of 10.

So dot length is next we'll say console dot log 10. Then else is over. Now, dot log and save it for reload. We get into them too. So if I just type in H e Ll all the foil character, we get Lem should be at least and as a W or data should be Dustin now fantastic before removed the day, nine Lam should be at least 10. That is validation, we can validate the contents on our page.

If you have any questions, feel free to call me a message. And as usual, I look forward to seeing you in the next JavaScript video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.