form validation for login and register pages

Basic form validation for the login and register pages.