+ 6
How to set required field in php and html ?
Required
2 ответов
+ 4
In html, simply add the required keyword in the input tag.
In php, just check if your post variable (or get but I strongly recommend post) is set and not empty! 😊
+ 2
do remember "required" attribute is available only in html5.
also allow form to be submitted only when all required fields are filled, then php side validation not require only.