I am in the process of validating a form that I will be using on my website in order to obtain certain details about a person of business that is registering an online account with us.
I am writing this question in order to obtain a bit of advice on how the validation the following types of information correctly.
In obtain to explain this, I will list a series of data types along with the html validation I had in mind. This could then be reused in a series of php validations amoung other things in order to ensure that the form is always validated correctly, however the standard html validation in my opinion looks better than anything I have been able to achieve by applying my own css.
First Names - ^[a-zA-Z -]{1,120}
(a-z, from 1 to 120 characters long, big or small letters)
Last Names - ^[a-zA-Z -]{1,120}
Email Addresses - ^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$
(validation including .com and .co.za domains which is what is mainly used)
If anyone has any suggestions relating to bettering these validation patterns or perhaps some others that are of more standard in use, that info would be greatly appreciated.
Also any information relating to why they should be or should not be used would be great too.
Thanks!!