-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
form validation #166 #171
base: beta
Are you sure you want to change the base?
form validation #166 #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A link for testing ?
form validation: show error under input
components/TForm.vue
Outdated
@input="(val) => onFieldChange(field, val)" | ||
/> | ||
</div> | ||
<div v-if="error" class="py-4 text-right text-red-500"> | ||
{{ error.message }} | ||
{{ errorMessage }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is no longer needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create a demo page with a custom form. I can't register/login neither with Google (auth domain is not configured) nor with email (it requires city to be filled, but autocomplete service is not configured)
@@ -69,6 +72,10 @@ export default { | |||
type: String, | |||
default: '', | |||
}, | |||
error: { | |||
type: String, | |||
default: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use empty string here to comply with type. AFAIK null is an object.
default: null, | |
default: '', |
b04c682
to
057d70e
Compare
What changed
Added validation to add event form
Display error message
How to test
try to save a new event while omitting the required form fields (event type,name,startDate) this fields has a validation attached to it and requires they are not null
Go To
https://thirsty-lalande-50b52c.netlify.app/
My Profile ---> Add Event ---> click Save without filling all fields
Closes #166