Can anyone explain me why we must mention name and value in the input attribute | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone explain me why we must mention name and value in the input attribute

21st Aug 2016, 6:59 PM
Manoj Srivatsav
Manoj Srivatsav - avatar
3 Answers
0
name is for sending the info to another page because without it How do you know what are you sending? and value is not necessary but if you want a default value you can use it
25th Aug 2016, 12:34 PM
Gerardo Mérida
Gerardo Mérida - avatar
0
to be frank you don't have to use any of them. especially nowadays when many pages uses Ajax and REST to communicate with server site. just for plain HTML FORM it is recommended to name your inputs so server can decode the attributes from FORM into variables. Furthermore there are distinct naming recommendations for different server side languages for example to map form attribures into an array variable
3rd Sep 2016, 9:14 AM
Jiří Tomeš
Jiří Tomeš - avatar
- 1
name is the title of the input. value is the choice
25th Aug 2016, 6:30 PM
Student Sonja Coy
Student Sonja Coy - avatar