I have a form in HTML5 and I want to add validation elements to the name, address and phone fields. So far I have the following code:
name='name' pattern='(-.''[A-Za-z])'
name='phone' pattern='[0-9+()x-' ']'
name='address' pattern='[0-9A-Za-z][.,#/\:;''&*]'
For the name, I need it to be able to accept the -'. symbols.
For the phone, I need it to be able to accept +()0-9 x and space.
For address, I need it to be able to accept all of the characters I've put there.
I'm not sure I've done it right though, as when testing I don't get error messages.
Never trust the user. Never forget back-end values verification.