Implement client side form validation

The first part of #48. Next part will be server side validation.