Use preventDefault to handle validation