Hi, I am looking at updating a site for someone and they have asked for some tweaks which are new to me, from having a look online it seems I need or its best to use serveral regex's to check prior to a form submission but I cant find a easy to follow tutorial which I could adapt. Any help or links to guides to follow please 1) first letter of a field must be a letter anything after is allowed 2) zip code in format of AB12 AB13 or AB1 AB1 must be uppercase 3) phone number in 12345 111111 or 1234 1234 4) email address (lowercase and check for @) 5) credit card to be 1234 1234 1234 1234 Thanks to anyone for taking the time to read my post.
Validating the input on the client's side seems rather pointless to me, because the user can just disable JavaScript and submit the form like he wants to. The input should always be validated on the server-side. If you want to do an additional pre-check, that's fine. But a waste of time, if you ask me.
Yes I agree, and I will again make a point to him of saying they should move to a server side validation, but client side pre checks are ok as well. Bit out of my depth I have done simplish javascript before to check if form fields are blank but this uppercase and formatting stuff seems to be quite intense.
Any pointers? The guides I have seem to just confuse me further, and I cant seem to find anything to help me test/try out variations.