How can one validate a form | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can one validate a form

in case an input is not filled

8th Aug 2017, 1:40 PM
Ntiri Ebenezer Kwasi
Ntiri Ebenezer Kwasi - avatar
2 Answers
0
best way is to put "required" in end of input tag.. <input type="text" name="name" required>
8th Aug 2017, 1:47 PM
Mohit Mehta
Mohit Mehta - avatar
0
also you can use if conditions.. for example, if you are storing input's value in $a variable then you can use "if($a=0) else"
9th Aug 2017, 1:20 PM
Mohit Mehta
Mohit Mehta - avatar