Implemented basic validation with ugly alerts.