Site URL
https://tamato.infinityfree.io
Form Validation with JavaScript!
This week I totally revamped my site. I used the site template that was available from this week’s content and changed the colors, pictures, and layout to personalize the site to my liking. The site had a lot of prebuilt functionality such as CSS for the buttons, headings, paragraphs, etc. I liked the flow of it and I kept most of it. I added in some of my own functionality from my previous site, like my fixedBox CSS code. I like the way it frames my content for the week. It is an easy way for me to explain the separation between my tasks.
The form validation was a little challenging to get working properly, but once I was able to figure out my issues, the rest flowed nicely. I like the ability to keep the pattern checker in it’s own variable, it makes for cleaner and easier to read code. I have it check down the line if the name is entered, if there is a valid email address, a valid 10 digit phone number with or without the () around the area code and a hyphen separating the last group of 3 and 4 digits. Then checks to see if there is a message, if any of those are incorrect and the user tries to submit the form, my site will give an alert and instruct the user on what the issue was.
Looking forward to PHP next week!
Leave a Reply