Thursday, May 29, 2014

Day 14: More sophisticated form validations

Alrighty so no morning lecture today so we dived right into the material. Yesterday I showed you an example of a really simple email validation page that directed to another page when successful and displayed error messsages when something didn't look right with the email. Today we took it up a notch (again) and made form validations for numerous input fields each having their own quirks.


This page (apologies for the lack of style) has numerous features. First it ensures that each input field has some valid data, makes sure the name fields don't have numbers in them, password has to have at least 7 characters, the birthdate has to be a valid date, and there needs to be a file chosen for upload. When any of these requirements aren't fulfilled, error messages are outputted and the respective input fields are highlighted. This pretty much is about what you'll find on the majority of web applications.

I'm starting to get very very comfortable with PHP. I gotta say it's extremely easy to use because you can simply enter your PHP code right into the HTML section (or wherever its needed). Up next we are going to learn how to connect these types of forms and store them into the database and also retrieve them. Exhausting but very exciting!

No comments:

Post a Comment