Client validate

Added client-side validation and nicer alerts.