Use preventDefault to handle validation

Let me know if this fixes what you were trying