I just got to know something new ( i know its not a very recent thing its just i was unaware of it till date ) that we can use HTML 5 inbuilt validation . You just have to include 'required' word in <input> tag and there will be an automatic validator.
<input name="something" type="text" required />
241b218d-db74-4d72-97ba-845ec2506fc9|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
HTML5
required, validator, HTML5