for developers of SoloLearn | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

for developers of SoloLearn

here is the mistake in the code: "e-mail" instead email

6th Apr 2019, 4:12 PM
Иван Чуверов
Иван Чуверов - avatar
10 Answers
+ 4
On the third slide, the label says for="e-mail" (with hyphen), but the name of the corresponding input is "email" (without hyphen) 🤓
6th Apr 2019, 5:11 PM
Anna
Anna - avatar
+ 4
Anna I might be wrong on this, but I'm pretty sure the value of the for attribute isn't bound to the name attribute for its corresponding element. I'm pretty sure the only requirement would be that it would need to be the same as its ID, which I'm pretty sure wasn't included in the example 🤷‍♂️
6th Apr 2019, 5:16 PM
Faisal
Faisal - avatar
+ 3
Иван Чуверов which code are you referring to can you please link it in this thread.
6th Apr 2019, 4:14 PM
MsJ
MsJ - avatar
+ 3
Faisal I have no idea, but it might be misleading that they use exactly the same labels on the second and third slides and the only difference is email vs. e-mail
6th Apr 2019, 5:24 PM
Anna
Anna - avatar
+ 3
Anna Yeah a little more consistency would definitely be helpful in tutorials like that, but I guess it could also be used as a way of showing that the for attribute doesn't have to be the same as the name attribute (although, I'm not sure how much more helpful having that would be haha)
6th Apr 2019, 5:32 PM
Faisal
Faisal - avatar
+ 2
It seems that there doesn't seem to be an error in the codes 🤔 If you're referring to the value of the for attribute for the <label> or the name attribute for the <input>, they can essentially be anything (albeit with some restrictions), so having e-mail shouldn't affect it too much
6th Apr 2019, 5:02 PM
Faisal
Faisal - avatar
6th Apr 2019, 4:46 PM
Иван Чуверов
Иван Чуверов - avatar
+ 1
Thanks for answer, I understood. But when I been solving this task I trying "execute code", it has been not working before I rid of "-" in the label.
6th Apr 2019, 5:12 PM
Иван Чуверов
Иван Чуверов - avatar
+ 1
hmm maybe I had bad connection for internet in that time ☺
6th Apr 2019, 5:14 PM
Иван Чуверов
Иван Чуверов - avatar
+ 1
Now it works as it is
6th Apr 2019, 5:15 PM
Иван Чуверов
Иван Чуверов - avatar