أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Use Ajax for form validation, because it has the power to work on the specific target instantly without impacting on any other part.
Best choice to use server side validation. Client side validation are harmful and hackers may attack on your web site. Client side code can be viewed in browser while server side code in parsed before render the page. I want to suggest you don't use html 5 require attribute to validate your input because it is removed if user want going to developer console by clicking inspect element.
Here is the best validation practices and tutorials!
https://www.smashingmagazine.com/2009/07/web-form-validation-best-practices-and-tutorials/
like -not accepting numerical values for alphabets or vice versa
- when the values are limited and known set then providing the drop down box so that restricting the values of inappropriate.
- radio buttons for yes/no, true/false, for known very limited kind of sets had to choose only one out of them
- check boxes when more than a option can be choosen out of limited set of values known prior.
few I can think of. sure they are very much useful for validation when you are designing UI.
My 2 cents. Thanks.
Most of php framework have theire own form validation (example : codeigniter form validation) -server side validation- as mentionned in Mohammad Aman answer,
but i think that the best is cited in this link http://formvalidation.io/
what do you think about?
hi,
please be more specific